Spaces:
Running
on
Zero
Running
on
Zero
jedick
commited on
Commit
·
bdde431
1
Parent(s):
657bdab
Add print statements for debugging with Gemma 3
Browse files- app.py +2 -6
- mods/tool_calling_llm.py +5 -5
app.py
CHANGED
|
@@ -22,14 +22,10 @@ load_dotenv(dotenv_path=".env", override=True)
|
|
| 22 |
|
| 23 |
# Download model snapshots from Hugging Face Hub
|
| 24 |
print(f"Downloading checkpoints for {model_id}...")
|
| 25 |
-
ckpt_dir = snapshot_download(
|
| 26 |
-
model_id, local_dir_use_symlinks=False, token=os.getenv("HF_TOKEN")
|
| 27 |
-
)
|
| 28 |
print(f"Using checkpoints from {ckpt_dir}")
|
| 29 |
print(f"Downloading checkpoints for {embedding_model_id}...")
|
| 30 |
-
embedding_ckpt_dir = snapshot_download(
|
| 31 |
-
embedding_model_id, local_dir_use_symlinks=False, token=os.getenv("HF_TOKEN")
|
| 32 |
-
)
|
| 33 |
print(f"Using embedding checkpoints from {embedding_ckpt_dir}")
|
| 34 |
|
| 35 |
# Download and extract data if data directory is not present
|
|
|
|
| 22 |
|
| 23 |
# Download model snapshots from Hugging Face Hub
|
| 24 |
print(f"Downloading checkpoints for {model_id}...")
|
| 25 |
+
ckpt_dir = snapshot_download(model_id, local_dir_use_symlinks=False)
|
|
|
|
|
|
|
| 26 |
print(f"Using checkpoints from {ckpt_dir}")
|
| 27 |
print(f"Downloading checkpoints for {embedding_model_id}...")
|
| 28 |
+
embedding_ckpt_dir = snapshot_download(embedding_model_id, local_dir_use_symlinks=False)
|
|
|
|
|
|
|
| 29 |
print(f"Using embedding checkpoints from {embedding_ckpt_dir}")
|
| 30 |
|
| 31 |
# Download and extract data if data directory is not present
|
mods/tool_calling_llm.py
CHANGED
|
@@ -177,9 +177,9 @@ class ToolCallingLLM(BaseChatModel, ABC):
|
|
| 177 |
# Extract <think>...</think> content and text after </think> for further processing 20250726 jmd
|
| 178 |
think_text, post_think = extract_think(response_message.content)
|
| 179 |
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
|
| 184 |
# Remove trailing comma (if there is one)
|
| 185 |
post_think = post_think.rstrip(",")
|
|
@@ -197,8 +197,8 @@ class ToolCallingLLM(BaseChatModel, ABC):
|
|
| 197 |
# Return entire response if JSON wasn't parsed or is missing
|
| 198 |
return AIMessage(content=response_message.content)
|
| 199 |
|
| 200 |
-
|
| 201 |
-
|
| 202 |
|
| 203 |
tool_calls = []
|
| 204 |
for parsed_json_result in parsed_json_results:
|
|
|
|
| 177 |
# Extract <think>...</think> content and text after </think> for further processing 20250726 jmd
|
| 178 |
think_text, post_think = extract_think(response_message.content)
|
| 179 |
|
| 180 |
+
# For debugging
|
| 181 |
+
print("post_think")
|
| 182 |
+
print(post_think)
|
| 183 |
|
| 184 |
# Remove trailing comma (if there is one)
|
| 185 |
post_think = post_think.rstrip(",")
|
|
|
|
| 197 |
# Return entire response if JSON wasn't parsed or is missing
|
| 198 |
return AIMessage(content=response_message.content)
|
| 199 |
|
| 200 |
+
print("parsed_json_results")
|
| 201 |
+
print(parsed_json_results)
|
| 202 |
|
| 203 |
tool_calls = []
|
| 204 |
for parsed_json_result in parsed_json_results:
|