Spaces:
Runtime error
Runtime error
Improving logs
Browse files- app.py +2 -2
- hf_utils.py +1 -0
app.py
CHANGED
|
@@ -18,10 +18,10 @@ configs = {
|
|
| 18 |
"os_model": "google/gemma-2b-it",
|
| 19 |
"device": "cpu",
|
| 20 |
"generation_config": {
|
| 21 |
-
"max_output_tokens":
|
| 22 |
"temperature": 1,
|
| 23 |
"top_p": 1,
|
| 24 |
-
"top_k":
|
| 25 |
},
|
| 26 |
}
|
| 27 |
|
|
|
|
| 18 |
"os_model": "google/gemma-2b-it",
|
| 19 |
"device": "cpu",
|
| 20 |
"generation_config": {
|
| 21 |
+
"max_output_tokens": 128,
|
| 22 |
"temperature": 1,
|
| 23 |
"top_p": 1,
|
| 24 |
+
"top_k": 4,
|
| 25 |
},
|
| 26 |
}
|
| 27 |
|
hf_utils.py
CHANGED
|
@@ -65,6 +65,7 @@ def query_word(
|
|
| 65 |
matched_word = ""
|
| 66 |
while not matched_word:
|
| 67 |
word = query_hf(query, model, tokenizer, generation_config, device)
|
|
|
|
| 68 |
|
| 69 |
# Extract word of interest from Gemma's output
|
| 70 |
for pattern in GEMMA_WORD_PATTERNS:
|
|
|
|
| 65 |
matched_word = ""
|
| 66 |
while not matched_word:
|
| 67 |
word = query_hf(query, model, tokenizer, generation_config, device)
|
| 68 |
+
logger.info(f"Evaluating result: '{word}'...")
|
| 69 |
|
| 70 |
# Extract word of interest from Gemma's output
|
| 71 |
for pattern in GEMMA_WORD_PATTERNS:
|