themissingCRAM commited on
Commit
c2cfe36
·
1 Parent(s): 54fbe78

transformerModel

Browse files
Files changed (2) hide show
  1. app.py +4 -4
  2. requirements.txt +1 -0
app.py CHANGED
@@ -22,7 +22,7 @@ from sqlalchemy import (
22
  )
23
  from huggingface_hub import login
24
  from Constants import BAKERY_ORDERS_DATA, BAKING_RECIPES, RAG_QUESTION, SQL_QUERY
25
-
26
  load_dotenv()
27
 
28
  @spaces.GPU
@@ -163,9 +163,9 @@ if __name__ == "__main__":
163
  model_id="Qwen/Qwen2.5-Coder-14B-Instruct",
164
  # model_id="meta-llama/Llama-3.2-3B-Instruct",
165
  device_map="cuda"
166
- ,max_new_tokens=5000
167
-
168
- ).bfloat16().cuda()
169
  # model = HfApiModel(
170
  # model_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
171
  # token = <YOUR-HF-TOKEN-HERE>
 
22
  )
23
  from huggingface_hub import login
24
  from Constants import BAKERY_ORDERS_DATA, BAKING_RECIPES, RAG_QUESTION, SQL_QUERY
25
+ import torch
26
  load_dotenv()
27
 
28
  @spaces.GPU
 
163
  model_id="Qwen/Qwen2.5-Coder-14B-Instruct",
164
  # model_id="meta-llama/Llama-3.2-3B-Instruct",
165
  device_map="cuda"
166
+ ,max_new_tokens=5000,torch_dtype=torch.bfloat16
167
+ )
168
+ model.tokenizer.pad()
169
  # model = HfApiModel(
170
  # model_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
171
  # token = <YOUR-HF-TOKEN-HERE>
requirements.txt CHANGED
@@ -11,3 +11,4 @@ langchain_community == 0.3.20
11
  chromadb == 0.6.3
12
  transformers == 4.50.3
13
  accelerate >=0.26.0
 
 
11
  chromadb == 0.6.3
12
  transformers == 4.50.3
13
  accelerate >=0.26.0
14
+ torch == 2.6.0