Spaces:
Runtime error
Runtime error
fixing errors
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import logging
|
2 |
import os
|
3 |
import string
|
|
|
4 |
|
5 |
import streamlit as st
|
6 |
from streamlit import session_state
|
@@ -17,12 +18,18 @@ CONFIGS_PATH = "configs.yaml"
|
|
17 |
MAX_TRIES = 6
|
18 |
CATEGORIES = ["Country", "Animal", "Food", "Movie"]
|
19 |
|
|
|
|
|
|
|
|
|
|
|
20 |
configs = {
|
21 |
-
"generation_config":
|
22 |
"max_output_tokens": 256,
|
23 |
"temperature": 1,
|
24 |
"top_p": 1,
|
25 |
"top_k": 32,
|
|
|
26 |
"os_model": "google/gemma-2b-it",
|
27 |
"device": "cpu",
|
28 |
}
|
|
|
1 |
import logging
|
2 |
import os
|
3 |
import string
|
4 |
+
import re
|
5 |
|
6 |
import streamlit as st
|
7 |
from streamlit import session_state
|
|
|
18 |
MAX_TRIES = 6
|
19 |
CATEGORIES = ["Country", "Animal", "Food", "Movie"]
|
20 |
|
21 |
+
GEMMA_WORD_PATTERNS = [
|
22 |
+
"(?<=\*)(.*?)(?=\*)",
|
23 |
+
'(?<=")(.*?)(?=")',
|
24 |
+
]
|
25 |
+
|
26 |
configs = {
|
27 |
+
"generation_config": {
|
28 |
"max_output_tokens": 256,
|
29 |
"temperature": 1,
|
30 |
"top_p": 1,
|
31 |
"top_k": 32,
|
32 |
+
},
|
33 |
"os_model": "google/gemma-2b-it",
|
34 |
"device": "cpu",
|
35 |
}
|