Spaces:
Runtime error
Runtime error
Ibrahemqasim
commited on
Commit
Β·
ab2323e
1
Parent(s):
7739b12
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ prompt_ar = "### Instruction: Ψ§Ψ³Ω
Ω Ψ¬ΩΨ³ ΩΨ³Ω
ΩΨͺ ΨΉΩΩ Ψ§Ψ³Ω
Ψ¬Ψ¨Ω Ψ¬
|
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
|
11 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
12 |
-
model = AutoModelForCausalLM.from_pretrained(model_path, device_map="auto", trust_remote_code=True)
|
13 |
-
|
14 |
|
15 |
def get_response(text,tokenizer=tokenizer,model=model):
|
16 |
input_ids = tokenizer(text, return_tensors="pt").input_ids
|
|
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
|
11 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
12 |
+
#model = AutoModelForCausalLM.from_pretrained(model_path, device_map="auto", trust_remote_code=True)
|
13 |
+
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.float16)
|
14 |
|
15 |
def get_response(text,tokenizer=tokenizer,model=model):
|
16 |
input_ids = tokenizer(text, return_tensors="pt").input_ids
|