Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,25 +10,24 @@ st.title("🤖 ShotCaller: Prompt Lab")
|
|
| 10 |
st.markdown("Explore how different prompting techniques change AI reasoning.")
|
| 11 |
|
| 12 |
# --- 2. Model Setup ---
|
| 13 |
-
# Retrieve your token from Hugging Face Settings > Secrets
|
| 14 |
api_token = os.getenv("HUGGINGFACEHUB_API_TOKEN")
|
| 15 |
|
| 16 |
if not api_token:
|
| 17 |
st.error("Missing HUGGINGFACEHUB_API_TOKEN. Add it to your Space Secrets!")
|
| 18 |
st.stop()
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
|
| 24 |
llm = HuggingFaceEndpoint(
|
| 25 |
repo_id=repo_id,
|
| 26 |
-
task="text-generation",
|
| 27 |
temperature=0.7,
|
| 28 |
-
huggingfacehub_api_token=api_token
|
|
|
|
| 29 |
)
|
| 30 |
|
| 31 |
-
#
|
| 32 |
chat_model = ChatHuggingFace(llm=llm)
|
| 33 |
|
| 34 |
# --- 3. Sidebar Selection ---
|
|
|
|
| 10 |
st.markdown("Explore how different prompting techniques change AI reasoning.")
|
| 11 |
|
| 12 |
# --- 2. Model Setup ---
|
|
|
|
| 13 |
api_token = os.getenv("HUGGINGFACEHUB_API_TOKEN")
|
| 14 |
|
| 15 |
if not api_token:
|
| 16 |
st.error("Missing HUGGINGFACEHUB_API_TOKEN. Add it to your Space Secrets!")
|
| 17 |
st.stop()
|
| 18 |
|
| 19 |
+
# Switching to Llama-3.1-8B-Instruct (Highly compatible)
|
| 20 |
+
repo_id = "meta-llama/Llama-3.1-8B-Instruct"
|
| 21 |
+
|
|
|
|
| 22 |
llm = HuggingFaceEndpoint(
|
| 23 |
repo_id=repo_id,
|
| 24 |
+
task="text-generation", # Base task
|
| 25 |
temperature=0.7,
|
| 26 |
+
huggingfacehub_api_token=api_token,
|
| 27 |
+
timeout=300
|
| 28 |
)
|
| 29 |
|
| 30 |
+
# This wrapper will now correctly identify Llama as a chat-capable model
|
| 31 |
chat_model = ChatHuggingFace(llm=llm)
|
| 32 |
|
| 33 |
# --- 3. Sidebar Selection ---
|