Nick088 commited on
Commit
c9744e9
1 Parent(s): 051f066

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -11,20 +11,13 @@ else:
11
  print("Using CPU")
12
 
13
  tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small")
14
- model = T5ForConditionalGeneration.from_pretrained("roborovski/superprompt-v1", device_map="auto", torch_dtype=model_precision_type
15
-
16
- model.to(device)
17
 
18
 
19
- def generate(
20
- prompt,
21
- max_new_tokens,
22
- repetition_penalty,
23
- temperature,
24
- top_p,
25
- top_k,
26
- seed
27
- ):
28
  input_text = f"Expand the following prompt to add more detail: {prompt}"
29
  input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to(device)
30
 
 
11
  print("Using CPU")
12
 
13
  tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small")
 
 
 
14
 
15
 
16
+ def generate(prompt, model_precision_type, max_new_tokens, repetition_penalty, temperature, top_p, top_k, seed):
17
+
18
+ model = T5ForConditionalGeneration.from_pretrained("roborovski/superprompt-v1", device_map="auto", torch_dtype=model_precision_type)
19
+ model.to(device)
20
+
 
 
 
 
21
  input_text = f"Expand the following prompt to add more detail: {prompt}"
22
  input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to(device)
23