Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,8 +4,12 @@
|
|
| 4 |
import gradio as gr
|
| 5 |
import os
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
# load a model from https://hf.co/models as an interface, then use it as an api
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
# define the core function
|
| 11 |
def complete_with_gpt(text):
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
import os
|
| 6 |
|
| 7 |
+
# save your HF API token from https:/hf.co/settings/tokens as an env variable to avoid rate limiting
|
| 8 |
+
auth_token = os.getenv("auth_token")
|
| 9 |
+
|
| 10 |
# load a model from https://hf.co/models as an interface, then use it as an api
|
| 11 |
+
# you can remove the api_key parameter if you don't care about rate limiting.
|
| 12 |
+
api = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B", api_key=auth_token)
|
| 13 |
|
| 14 |
# define the core function
|
| 15 |
def complete_with_gpt(text):
|