navid72m commited on
Commit
5082ba6
·
2 Parent(s): 38320c3 6f9ac18
Files changed (2) hide show
  1. Dockerfile +2 -0
  2. selection.py +2 -0
Dockerfile CHANGED
@@ -20,6 +20,8 @@ RUN mkdir -p /.cache && chmod -R 777 /.cache
20
  # Change ownership of working directory (if necessary)
21
  RUN chown -R root:root /usr/local/bin
22
 
 
 
23
  RUN pip install -r requirements.txt
24
 
25
 
 
20
  # Change ownership of working directory (if necessary)
21
  RUN chown -R root:root /usr/local/bin
22
 
23
+ RUN pip install transformers
24
+
25
  RUN pip install -r requirements.txt
26
 
27
 
selection.py CHANGED
@@ -38,6 +38,7 @@ model_name = "misteralai/mistral_7b_en" # Replace with the appropriate Mistral
38
  tokenizer = AutoTokenizer.from_pretrained(model_name)
39
  model = AutoModelForCausalLM.from_pretrained(model_name)
40
 
 
41
  # Tokenize the input
42
  input_ids = tokenizer.encode(instruction, return_tensors='pt')
43
 
@@ -47,3 +48,4 @@ outputs = model.generate(input_ids, max_new_tokens=150, num_return_sequences=1)
47
  # Decode the response
48
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
49
  print(response)
 
 
38
  tokenizer = AutoTokenizer.from_pretrained(model_name)
39
  model = AutoModelForCausalLM.from_pretrained(model_name)
40
 
41
+
42
  # Tokenize the input
43
  input_ids = tokenizer.encode(instruction, return_tensors='pt')
44
 
 
48
  # Decode the response
49
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
50
  print(response)
51
+