plannist commited on
Commit
47df46f
·
1 Parent(s): 2d51003

setting change

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -22,8 +22,11 @@ pipe = pipeline(
22
  )
23
 
24
  def chat_fn(prompt):
25
- output = pipe(prompt)[0]["generated_text"]
26
- return [output]
 
 
 
27
 
28
  demo = gr.Interface(fn=chat_fn, inputs="text", outputs="text")
29
- demo.launch(ssr_mode=False, share=True)
 
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)