Spaces:
Sleeping
Sleeping
Luke Stanley
commited on
Commit
·
c013599
1
Parent(s):
5da2aef
Revert expected serverless output metadata stripper
Browse files
utils.py
CHANGED
|
@@ -152,7 +152,6 @@ def llm_stream_sans_network(
|
|
| 152 |
return json_output
|
| 153 |
|
| 154 |
|
| 155 |
-
# Function to call the RunPod API with a Pydantic model and movie name
|
| 156 |
def llm_stream_serverless(prompt,model):
|
| 157 |
RUNPOD_ENDPOINT_ID = env.get("RUNPOD_ENDPOINT_ID")
|
| 158 |
RUNPOD_API_KEY = env.get("RUNPOD_API_KEY")
|
|
@@ -174,7 +173,8 @@ def llm_stream_serverless(prompt,model):
|
|
| 174 |
response = requests.post(url, json=data, headers=headers)
|
| 175 |
result = response.json()
|
| 176 |
print(result)
|
| 177 |
-
output = result['output']
|
|
|
|
| 178 |
return json.loads(output)
|
| 179 |
|
| 180 |
def query_ai_prompt(prompt, replacements, model_class):
|
|
|
|
| 152 |
return json_output
|
| 153 |
|
| 154 |
|
|
|
|
| 155 |
def llm_stream_serverless(prompt,model):
|
| 156 |
RUNPOD_ENDPOINT_ID = env.get("RUNPOD_ENDPOINT_ID")
|
| 157 |
RUNPOD_API_KEY = env.get("RUNPOD_API_KEY")
|
|
|
|
| 173 |
response = requests.post(url, json=data, headers=headers)
|
| 174 |
result = response.json()
|
| 175 |
print(result)
|
| 176 |
+
output = result['output'].replace("model:mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf\n", "")
|
| 177 |
+
# TODO: remove replacement once new version of runpod is deployed
|
| 178 |
return json.loads(output)
|
| 179 |
|
| 180 |
def query_ai_prompt(prompt, replacements, model_class):
|