Spaces:
Running
Running
Update src/insight.py
Browse files- src/insight.py +4 -2
src/insight.py
CHANGED
@@ -10,8 +10,10 @@ model_id = "google/gemma-3n-E4B-it"
|
|
10 |
|
11 |
|
12 |
hf_token = os.environ.get("HUGGINGFACE_TOKEN")
|
13 |
-
|
14 |
-
|
|
|
|
|
15 |
|
16 |
def call_llm(prompt):
|
17 |
inputs = tokenizer(prompt, return_tensors="pt", truncation=True)
|
|
|
10 |
|
11 |
|
12 |
hf_token = os.environ.get("HUGGINGFACE_TOKEN")
|
13 |
+
cache_dir = "/tmp/hf_cache"
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, token=hf_token, cache_dir=cache_dir)
|
15 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, token=hf_token, cache_dir=cache_dir)
|
16 |
+
|
17 |
|
18 |
def call_llm(prompt):
|
19 |
inputs = tokenizer(prompt, return_tensors="pt", truncation=True)
|