freddyaboulton HF staff commited on
Commit
a2e12c6
β€’
1 Parent(s): 3ab75c1
Files changed (1) hide show
  1. app.py +22 -5
app.py CHANGED
@@ -50,18 +50,35 @@ with gr.Blocks() as demo:
50
  gr.Markdown("""
51
  # Falcon-7b-instruct Discord Bot Powered by Gradio and Hugging Face Endpoints
52
 
53
- To deploy this space as a discord bot, you will need to deploy your own Falcon model to Hugging Face Endpoints.
54
- Don't worry it's super easy.
55
-
56
-
57
  ```bash
58
  pip install gradio_client
59
  ```
60
 
61
  ```python
62
- grc.Client.duplicate("gradio-discord-bots/falcon-7b-instruct", private=False, secrets={"HF_TOKEN": "<your-key-here>", "INFERENCE_ENDPOINT": "<endpoint-url>"}).deploy_discord()
 
63
  ```
64
  """)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  button = gr.Button(visible=False)
66
  history = gr.State([])
67
  message = gr.Textbox(visible=False)
 
50
  gr.Markdown("""
51
  # Falcon-7b-instruct Discord Bot Powered by Gradio and Hugging Face Endpoints
52
 
53
+ Make sure you read the 'Inference Endpoints' section below first! πŸ¦…
54
+
 
 
55
  ```bash
56
  pip install gradio_client
57
  ```
58
 
59
  ```python
60
+ grc.Client.duplicate("gradio-discord-bots/falcon-7b-instruct", private=False,
61
+ secrets={"HF_TOKEN": "<your-key-here>", "INFERENCE_ENDPOINT": "<endpoint-url>"}).deploy_discord()
62
  ```
63
  """)
64
+ with gr.Accordion(label="Inference Endpoints", open=False):
65
+ gr.Markdown("""
66
+ ## Setting Up Inference Endpoints πŸ’ͺ
67
+ To deploy this space as a discord bot, you will need to deploy your own Falcon model to Hugging Face Endpoints.
68
+ Don't worry it's super easy!
69
+
70
+ 1. Go to the [model page](tiiuae/falcon-7b-instruct) πŸ¦…
71
+ 2. Click Deploy > Inference Endpoints
72
+ <img src="https://gradio-builds.s3.amazonaws.com/demo-files/discordbots/inference_endpoints/modelpage.png" alt="drawing" width="800" height=400/>
73
+ 3. Select your desired cloud provider and region ☁️
74
+ <img src="https://gradio-builds.s3.amazonaws.com/demo-files/discordbots/inference_endpoints/falcon_instruct.png" alt="drawing" width="800" height=400/>
75
+ 4. Optional: Set Automatic Scale to Zero. This will pause your endpoint after 15 minutes of inactivity to prevent unwanted billing. πŸ’°
76
+ <img src="https://gradio-builds.s3.amazonaws.com/demo-files/discordbots/inference_endpoints/autoscale.png" alt="drawing" width="800" height=400/>
77
+ 5. Create the endpoint! Copy the endpoint URL after it's complete.
78
+ <img src="https://gradio-builds.s3.amazonaws.com/demo-files/discordbots/inference_endpoints/running_model.png" alt="drawing" width="800" height=400/>
79
+ """
80
+ )
81
+
82
  button = gr.Button(visible=False)
83
  history = gr.State([])
84
  message = gr.Textbox(visible=False)