plannist
commited on
Commit
·
47df46f
1
Parent(s):
2d51003
setting change
Browse files
app.py
CHANGED
@@ -22,8 +22,11 @@ pipe = pipeline(
|
|
22 |
)
|
23 |
|
24 |
def chat_fn(prompt):
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
27 |
|
28 |
demo = gr.Interface(fn=chat_fn, inputs="text", outputs="text")
|
29 |
-
demo.launch(
|
|
|
22 |
)
|
23 |
|
24 |
def chat_fn(prompt):
|
25 |
+
try:
|
26 |
+
output = pipe(prompt)[0]["generated_text"]
|
27 |
+
return [output]
|
28 |
+
except Exception as e:
|
29 |
+
return [f"Error: {str(e)}"]
|
30 |
|
31 |
demo = gr.Interface(fn=chat_fn, inputs="text", outputs="text")
|
32 |
+
demo.launch(share=True)
|