danavirtual commited on
Commit
9904ac6
Β·
1 Parent(s): 43deac1

config_device=meta

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,6 +14,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteria,
14
 
15
 
16
  import config
 
17
 
18
  INSTRUCTION_KEY = "### Instruction:"
19
  RESPONSE_KEY = "### Response:"
@@ -116,7 +117,7 @@ print (f"sys.path : {sys.path}")
116
 
117
 
118
  def complete(state="complete"):
119
- print(f"\nCell {state} @ {(datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S'))}")
120
 
121
  complete(state='imports done')
122
 
@@ -193,7 +194,6 @@ def tester(uPrompt, max_new_tokens, temperature, top_k, top_p):
193
  results = f"{salutation} max_new_tokens{max_new_tokens}; temperature{temperature}; top_k{top_k}; top_p{top_p}; "
194
 
195
  return response
196
- config.init_device="meta"
197
  demo = gr.Interface(
198
  fn=tester,
199
  inputs=[gr.Textbox(label="Prompt",info="Prompt",lines=3,value="Provide Prompt"),
 
14
 
15
 
16
  import config
17
+ config.init_device="meta"
18
 
19
  INSTRUCTION_KEY = "### Instruction:"
20
  RESPONSE_KEY = "### Response:"
 
117
 
118
 
119
  def complete(state="complete"):
120
+ print(f"\nCell {state}")
121
 
122
  complete(state='imports done')
123
 
 
194
  results = f"{salutation} max_new_tokens{max_new_tokens}; temperature{temperature}; top_k{top_k}; top_p{top_p}; "
195
 
196
  return response
 
197
  demo = gr.Interface(
198
  fn=tester,
199
  inputs=[gr.Textbox(label="Prompt",info="Prompt",lines=3,value="Provide Prompt"),