Spaces:
Runtime error
Runtime error
Commit
·
253ae14
1
Parent(s):
884c66a
Update app.py
Browse files
app.py
CHANGED
@@ -30,17 +30,17 @@ question_prompt_template = """
|
|
30 |
prompt = PromptTemplate(input_variables=["i","input", "question"], template=question_prompt_template)
|
31 |
|
32 |
async def get_answer(question):
|
33 |
-
|
34 |
resp = await gpt4.Completion().create(question)
|
35 |
return resp
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
|
45 |
def img_to_bytes(img_path):
|
46 |
img_bytes = Path(img_path).read_bytes()
|
|
|
30 |
prompt = PromptTemplate(input_variables=["i","input", "question"], template=question_prompt_template)
|
31 |
|
32 |
async def get_answer(question):
|
33 |
+
try:
|
34 |
resp = await gpt4.Completion().create(question)
|
35 |
return resp
|
36 |
|
37 |
+
except:
|
38 |
+
try:
|
39 |
+
resp = await gpt3.Completion().create(question)
|
40 |
+
return resp
|
41 |
+
except:
|
42 |
+
st.info('Service may be stopped or you are disconnected with internet. Feel free to open an issue here "https://github.com/Mohamed01555/VideoQuERI"')
|
43 |
+
st.stop()
|
44 |
|
45 |
def img_to_bytes(img_path):
|
46 |
img_bytes = Path(img_path).read_bytes()
|