Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,7 @@ system_message = "A model that takes sentence in English which may contain gramm
|
|
| 10 |
model_name = 'ft:gpt-3.5-turbo-1106:infercia::8n84ogUY'
|
| 11 |
|
| 12 |
def check_grammar(text):
|
|
|
|
| 13 |
try:
|
| 14 |
response = openai.ChatCompletion.create(
|
| 15 |
model=model_name,
|
|
@@ -25,7 +26,7 @@ def check_grammar(text):
|
|
| 25 |
print(response.choices[0])
|
| 26 |
return response.choices[0].message.content
|
| 27 |
except Exception as e:
|
| 28 |
-
print('
|
| 29 |
print(response.choices[0])
|
| 30 |
return str(e)
|
| 31 |
|
|
|
|
| 10 |
model_name = 'ft:gpt-3.5-turbo-1106:infercia::8n84ogUY'
|
| 11 |
|
| 12 |
def check_grammar(text):
|
| 13 |
+
response = {{'choices': [{'message': {'content': 'Error Communicating'}}]}}
|
| 14 |
try:
|
| 15 |
response = openai.ChatCompletion.create(
|
| 16 |
model=model_name,
|
|
|
|
| 26 |
print(response.choices[0])
|
| 27 |
return response.choices[0].message.content
|
| 28 |
except Exception as e:
|
| 29 |
+
print('Error Happened Here!')
|
| 30 |
print(response.choices[0])
|
| 31 |
return str(e)
|
| 32 |
|