Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ if not HUGGINGFACE_API_TOKEN:
|
|
| 32 |
print("Go to your Space's Settings > Repository secrets to add it.")
|
| 33 |
|
| 34 |
# The default AI model
|
| 35 |
-
DEFAULT_MODEL = "
|
| 36 |
|
| 37 |
|
| 38 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -184,13 +184,8 @@ FEW_SHOT_OUTPUT = json.dumps({
|
|
| 184 |
from huggingface_hub import InferenceClient
|
| 185 |
|
| 186 |
def call_huggingface_model(referral_text: str, model_id: str = DEFAULT_MODEL) -> str:
|
| 187 |
-
"""
|
| 188 |
-
Send the referral text to a Hugging Face model and get the response.
|
| 189 |
-
Uses InferenceClient which handles routing internally.
|
| 190 |
-
"""
|
| 191 |
client = InferenceClient(token=HUGGINGFACE_API_TOKEN)
|
| 192 |
|
| 193 |
-
# Build the conversation messages
|
| 194 |
messages = [
|
| 195 |
{"role": "system", "content": SYSTEM_PROMPT},
|
| 196 |
{"role": "user", "content": f"Example referral:\n{FEW_SHOT_INPUT}"},
|
|
@@ -405,12 +400,12 @@ with gr.Blocks(
|
|
| 405 |
gr.Markdown("### Input")
|
| 406 |
model_dropdown = gr.Dropdown(
|
| 407 |
choices=[
|
| 408 |
-
"
|
| 409 |
-
"
|
| 410 |
-
"
|
| 411 |
-
"
|
| 412 |
],
|
| 413 |
-
value="
|
| 414 |
label="AI Model",
|
| 415 |
info="Try different models to compare results"
|
| 416 |
)
|
|
|
|
| 32 |
print("Go to your Space's Settings > Repository secrets to add it.")
|
| 33 |
|
| 34 |
# The default AI model
|
| 35 |
+
DEFAULT_MODEL = "Qwen/Qwen2.5-72B-Instruct"
|
| 36 |
|
| 37 |
|
| 38 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 184 |
from huggingface_hub import InferenceClient
|
| 185 |
|
| 186 |
def call_huggingface_model(referral_text: str, model_id: str = DEFAULT_MODEL) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
client = InferenceClient(token=HUGGINGFACE_API_TOKEN)
|
| 188 |
|
|
|
|
| 189 |
messages = [
|
| 190 |
{"role": "system", "content": SYSTEM_PROMPT},
|
| 191 |
{"role": "user", "content": f"Example referral:\n{FEW_SHOT_INPUT}"},
|
|
|
|
| 400 |
gr.Markdown("### Input")
|
| 401 |
model_dropdown = gr.Dropdown(
|
| 402 |
choices=[
|
| 403 |
+
"Qwen/Qwen2.5-72B-Instruct",
|
| 404 |
+
"meta-llama/Meta-Llama-3.1-8B-Instruct",
|
| 405 |
+
"mistralai/Mistral-Nemo-Instruct-2407",
|
| 406 |
+
"microsoft/Phi-3.5-mini-instruct",
|
| 407 |
],
|
| 408 |
+
value="Qwen/Qwen2.5-72B-Instruct",
|
| 409 |
label="AI Model",
|
| 410 |
info="Try different models to compare results"
|
| 411 |
)
|