Norod78 commited on
Commit
4d33e30
1 Parent(s): e742cdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -30,8 +30,9 @@ def generate_fakypedia(article_title: str):
30
  with torch.no_grad():
31
  result = ""
32
  string_to_tokenize= f"{bos_token}\\%{article_title}"
33
- input_ids = tokenizer( string_to_tokenize, return_tensors="pt").input_ids.to(device)
34
- sample_outputs = model.generate(input_ids, do_sample=True,repetition_penalty=1.2, temperature=0.5, max_length=192, num_return_sequences=3)
 
35
  if article_title == None or len(article_title) == 0:
36
  result += f"# Fakypedia results with random titles \n"
37
  article_title = ""
 
30
  with torch.no_grad():
31
  result = ""
32
  string_to_tokenize= f"{bos_token}\\%{article_title}"
33
+ input_ids = tokenizer( string_to_tokenize, return_tensors="pt").input_ids.to(device)
34
+ sample_outputs = model.generate(input_ids, do_sample=True,repetition_penalty=1.05, top_k = 40, top_p = 0.950, temperature=0.80, max_length=192, num_return_sequences=3)
35
+ #sample_outputs = model.generate(input_ids, do_sample=True,repetition_penalty=1.2, temperature=0.5, max_length=192, num_return_sequences=3)
36
  if article_title == None or len(article_title) == 0:
37
  result += f"# Fakypedia results with random titles \n"
38
  article_title = ""