Spaces:
Sleeping
Sleeping
freQuensy23
commited on
Commit
•
4465f32
1
Parent(s):
276e2b6
t5 empty response
Browse files- generators.py +4 -1
generators.py
CHANGED
@@ -42,7 +42,10 @@ async def generate_t5(system_input, user_input):
|
|
42 |
output = await query_llm({
|
43 |
"inputs": (inputs := f"{system_input}\n{user_input}"),
|
44 |
}, "google/flan-t5-large")
|
45 |
-
|
|
|
|
|
|
|
46 |
|
47 |
|
48 |
async def generate_gpt2(system_input, user_input):
|
|
|
42 |
output = await query_llm({
|
43 |
"inputs": (inputs := f"{system_input}\n{user_input}"),
|
44 |
}, "google/flan-t5-large")
|
45 |
+
try:
|
46 |
+
yield output[0]["generated_text"]
|
47 |
+
except (IndexError, KeyError):
|
48 |
+
yield str(output)
|
49 |
|
50 |
|
51 |
async def generate_gpt2(system_input, user_input):
|