Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,9 @@ from huggingface_hub import InferenceClient
|
|
5 |
# Retrieve the API token from the environment variable
|
6 |
api_token = os.getenv("HF_API_TOKEN")
|
7 |
|
|
|
|
|
|
|
8 |
# Replace with your model repository
|
9 |
client = InferenceClient(model="brdemorin/Phi3_80_steps_v2", token=api_token)
|
10 |
|
@@ -60,4 +63,4 @@ demo = gr.ChatInterface(
|
|
60 |
)
|
61 |
|
62 |
if __name__ == "__main__":
|
63 |
-
demo.launch()
|
|
|
5 |
# Retrieve the API token from the environment variable
|
6 |
api_token = os.getenv("HF_API_TOKEN")
|
7 |
|
8 |
+
if not api_token:
|
9 |
+
raise ValueError("API token is missing. Please set it in Hugging Face Secrets.")
|
10 |
+
|
11 |
# Replace with your model repository
|
12 |
client = InferenceClient(model="brdemorin/Phi3_80_steps_v2", token=api_token)
|
13 |
|
|
|
63 |
)
|
64 |
|
65 |
if __name__ == "__main__":
|
66 |
+
demo.launch(share=True)
|