Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,9 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
-
|
4 |
# ✅ Add your Hugging Face API token here
|
5 |
-
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta", token=
|
6 |
|
7 |
def explain_and_run_code(code_snippet):
|
8 |
system_message = "You are an expert assistant that explains Python code snippets clearly and concisely."
|
|
|
1 |
+
import os
|
2 |
import gradio as gr
|
3 |
from huggingface_hub import InferenceClient
|
4 |
+
hfapi_token=os.getenv('hf_api_token')
|
5 |
# ✅ Add your Hugging Face API token here
|
6 |
+
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta", token=hfapi_token)
|
7 |
|
8 |
def explain_and_run_code(code_snippet):
|
9 |
system_message = "You are an expert assistant that explains Python code snippets clearly and concisely."
|