kadirnar commited on
Commit
9dd27cf
1 Parent(s): e982c06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -36,11 +36,8 @@ def biogpt(
36
  ):
37
 
38
  en_prompt = translate_to_english(prompt, lang_model_id, base_lang)
39
- model = BioGptForCausalLM.from_pretrained(biogpt_model_id)
40
- tokenizer = BioGptTokenizer.from_pretrained(biogpt_model_id)
41
- generator = pipeline('text-generation', model=model, tokenizer=tokenizer, device='cuda:0')
42
- set_seed(42)
43
- output = generator(en_prompt, max_length=max_length, num_return_sequences=num_return_sequences, do_sample=True)
44
  output_dict = {}
45
  for i in range(num_return_sequences):
46
  output_dict[str(i+1)] = output[i]['generated_text']
 
36
  ):
37
 
38
  en_prompt = translate_to_english(prompt, lang_model_id, base_lang)
39
+ generator = pipeline('text-generation', device='cuda:0')
40
+ output = generator(en_prompt, model=biogpt_model_id, max_length=max_length, num_return_sequences=num_return_sequences, do_sample=True)
 
 
 
41
  output_dict = {}
42
  for i in range(num_return_sequences):
43
  output_dict[str(i+1)] = output[i]['generated_text']