eljanmahammadli commited on
Commit
6fda9d8
1 Parent(s): 4cd52ce

remove comments

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -33,7 +33,7 @@ def answer_question(history, temperature, top_p, repetition_penalty, top_k, ques
33
  "top_p": top_p,
34
  "repetition_penalty": repetition_penalty,
35
  "top_k": top_k,
36
- "max_length": 512, # Adjust based on your needs
37
  "do_sample": True,
38
  }
39
  prompt = get_prompt(question)
@@ -42,7 +42,7 @@ def answer_question(history, temperature, top_p, repetition_penalty, top_k, ques
42
  divider = "\n\n" if history else ""
43
  print(answer)
44
  new_history = history + divider + f"USER: {question}\nASSISTANT: {answer}\n"
45
- return new_history, "" # Return updated history and clear the question input
46
 
47
 
48
  def send_action(_=None):
@@ -58,7 +58,6 @@ with gr.Blocks() as app:
58
  gr.Image(
59
  value=logo_path,
60
  )
61
- # write info about the model
62
  gr.Markdown(
63
  "### Model Info\n"
64
  "This model is a 150M paramater LLaMA2 model trained from scratch on Azerbaijani text. It can be used to generate text based on the given prompt. \n\nAlso note that this is very small model which can be scaled up in terms of data and model size to get better results.\n\nPlease ask general knowledge questions to the model.\n\nAlso play with the model settings especially the temperature."
 
33
  "top_p": top_p,
34
  "repetition_penalty": repetition_penalty,
35
  "top_k": top_k,
36
+ "max_length": 512,
37
  "do_sample": True,
38
  }
39
  prompt = get_prompt(question)
 
42
  divider = "\n\n" if history else ""
43
  print(answer)
44
  new_history = history + divider + f"USER: {question}\nASSISTANT: {answer}\n"
45
+ return new_history, ""
46
 
47
 
48
  def send_action(_=None):
 
58
  gr.Image(
59
  value=logo_path,
60
  )
 
61
  gr.Markdown(
62
  "### Model Info\n"
63
  "This model is a 150M paramater LLaMA2 model trained from scratch on Azerbaijani text. It can be used to generate text based on the given prompt. \n\nAlso note that this is very small model which can be scaled up in terms of data and model size to get better results.\n\nPlease ask general knowledge questions to the model.\n\nAlso play with the model settings especially the temperature."