freddyaboulton HF staff commited on
Commit
64cc282
1 Parent(s): 8847024

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -1
app.py CHANGED
@@ -49,4 +49,24 @@ def predict(inputs, chatbot):
49
  partial_message = partial_message + chunk['choices'][0]['delta']['content']
50
  yield partial_message
51
 
52
- gr.ChatInterface(predict).queue().launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  partial_message = partial_message + chunk['choices'][0]['delta']['content']
50
  yield partial_message
51
 
52
+
53
+ interface = gr.ChatInterface(predict)
54
+ with gr.Blocks() as demo:
55
+ gr.Markdown("""
56
+ # GPT 3.5 Discord Bot powered by gradio!
57
+
58
+ To use this space as a discord bot, first install the gradio_client
59
+
60
+ ```bash
61
+ pip install gradio_client
62
+ ```
63
+
64
+ Then run the following command
65
+
66
+ ```python
67
+ grc.Client.duplicate("gradio-discord-bots/gpt-35-turbo", secrets={"OPENAI_API_KEY": "<your-key-here>"}).deploy_discord()
68
+ """)
69
+ with gr.Row(visible=False):
70
+ interface.render()
71
+
72
+ .queue().launch()