Spaces:
Running
Running
Commit
·
1bc0f81
1
Parent(s):
c7403e5
Show friendly display names for free models (e.g. 'Qwen3 235B' instead of full API name)
Browse files
app.py
CHANGED
|
@@ -52,17 +52,19 @@ def extract_text_from_pdfs(pdf_paths):
|
|
| 52 |
print(f"Error extracting text from {pdf_path}: {e}")
|
| 53 |
return all_texts
|
| 54 |
|
| 55 |
-
# Free models
|
| 56 |
-
|
| 57 |
-
"Qwen/Qwen3-VL-235B-A22B-Instruct:novita",
|
| 58 |
-
"deepseek-ai/DeepSeek-V3.1:novita",
|
| 59 |
-
"meta-llama/Llama-3.3-70B-Instruct:groq",
|
| 60 |
-
"gemini-2.5-flash",
|
| 61 |
-
"gpt-4o-mini",
|
| 62 |
-
"mistral-medium-2505",
|
| 63 |
-
"claude-3-haiku-20240307",
|
| 64 |
-
"grok-4-fast-non-reasoning",
|
| 65 |
-
|
|
|
|
|
|
|
| 66 |
|
| 67 |
# Paid models (user provides their own API key)
|
| 68 |
PAID_MODEL_CHOICES = [
|
|
@@ -824,7 +826,8 @@ with col_input:
|
|
| 824 |
)
|
| 825 |
|
| 826 |
if model_tier == "Free Models":
|
| 827 |
-
|
|
|
|
| 828 |
api_key = ""
|
| 829 |
st.info("**Free tier** - no API key required!")
|
| 830 |
else:
|
|
@@ -947,7 +950,8 @@ with col_input:
|
|
| 947 |
)
|
| 948 |
|
| 949 |
if model_tier == "Free Models":
|
| 950 |
-
|
|
|
|
| 951 |
api_key = ""
|
| 952 |
st.info("**Free tier** - no API key required!")
|
| 953 |
else:
|
|
|
|
| 52 |
print(f"Error extracting text from {pdf_path}: {e}")
|
| 53 |
return all_texts
|
| 54 |
|
| 55 |
+
# Free models - display name -> actual API model name
|
| 56 |
+
FREE_MODELS_MAP = {
|
| 57 |
+
"Qwen3 235B": "Qwen/Qwen3-VL-235B-A22B-Instruct:novita",
|
| 58 |
+
"DeepSeek V3.1": "deepseek-ai/DeepSeek-V3.1:novita",
|
| 59 |
+
"Llama 3.3 70B": "meta-llama/Llama-3.3-70B-Instruct:groq",
|
| 60 |
+
"Gemini 2.5 Flash": "gemini-2.5-flash",
|
| 61 |
+
"GPT-4o Mini": "gpt-4o-mini",
|
| 62 |
+
"Mistral Medium": "mistral-medium-2505",
|
| 63 |
+
"Claude 3 Haiku": "claude-3-haiku-20240307",
|
| 64 |
+
"Grok 4 Fast": "grok-4-fast-non-reasoning",
|
| 65 |
+
}
|
| 66 |
+
FREE_MODEL_DISPLAY_NAMES = list(FREE_MODELS_MAP.keys())
|
| 67 |
+
FREE_MODEL_CHOICES = list(FREE_MODELS_MAP.values()) # Keep for backward compat
|
| 68 |
|
| 69 |
# Paid models (user provides their own API key)
|
| 70 |
PAID_MODEL_CHOICES = [
|
|
|
|
| 826 |
)
|
| 827 |
|
| 828 |
if model_tier == "Free Models":
|
| 829 |
+
model_display = st.selectbox("Model", options=FREE_MODEL_DISPLAY_NAMES, key="extract_model")
|
| 830 |
+
model = FREE_MODELS_MAP[model_display] # Convert to actual model name
|
| 831 |
api_key = ""
|
| 832 |
st.info("**Free tier** - no API key required!")
|
| 833 |
else:
|
|
|
|
| 950 |
)
|
| 951 |
|
| 952 |
if model_tier == "Free Models":
|
| 953 |
+
model_display = st.selectbox("Model", options=FREE_MODEL_DISPLAY_NAMES, key="classify_model")
|
| 954 |
+
model = FREE_MODELS_MAP[model_display] # Convert to actual model name
|
| 955 |
api_key = ""
|
| 956 |
st.info("**Free tier** - no API key required!")
|
| 957 |
else:
|