Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -38,6 +38,13 @@ MAX_NEW_TOKENS = 1000
|
|
38 |
tokenizer = None
|
39 |
model = None
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
class SafeGeocoder:
|
42 |
def __init__(self):
|
43 |
user_agent = f"location_mapper_v1_{random.randint(1000, 9999)}"
|
|
|
38 |
tokenizer = None
|
39 |
model = None
|
40 |
|
41 |
+
try:
|
42 |
+
from transformers.models.qwen2.tokenization_qwen2 import Qwen2Tokenizer
|
43 |
+
from transformers.models.qwen2.modeling_qwen2 import Qwen2ForCausalLM
|
44 |
+
print("Qwen2 components successfully imported")
|
45 |
+
except ImportError:
|
46 |
+
print("Could not import Qwen2 components directly")
|
47 |
+
|
48 |
class SafeGeocoder:
|
49 |
def __init__(self):
|
50 |
user_agent = f"location_mapper_v1_{random.randint(1000, 9999)}"
|