Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -91,6 +91,7 @@ async def core():
|
|
91 |
|
92 |
|
93 |
def getPrompt(prompt, modelID, attempts=1):
|
|
|
94 |
if modelID != magic_prompt_model:
|
95 |
chat = [
|
96 |
{"role": "user", "content": prompt_base},
|
@@ -98,7 +99,7 @@ def getPrompt(prompt, modelID, attempts=1):
|
|
98 |
{"role": "user", "content": prompt},
|
99 |
]
|
100 |
try:
|
101 |
-
response =
|
102 |
except Exception as e:
|
103 |
print(f"An error occurred: {e}")
|
104 |
if attempts < 3:
|
|
|
91 |
|
92 |
|
93 |
def getPrompt(prompt, modelID, attempts=1):
|
94 |
+
response = {}
|
95 |
if modelID != magic_prompt_model:
|
96 |
chat = [
|
97 |
{"role": "user", "content": prompt_base},
|
|
|
99 |
{"role": "user", "content": prompt},
|
100 |
]
|
101 |
try:
|
102 |
+
response = groqClient.chat.completions.create(messages=chat, temperature=1, max_tokens=2048, top_p=1, stream=False, stop=None, model=modelID)
|
103 |
except Exception as e:
|
104 |
print(f"An error occurred: {e}")
|
105 |
if attempts < 3:
|