Ibrahemqasim commited on
Commit
ab2323e
Β·
1 Parent(s): 7739b12

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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