vpcom commited on
Commit
acd3d26
1 Parent(s): ba2d4df

fix: prompt has been updated

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -118,13 +118,14 @@ def generate(
118
  global HISTORY
119
  HISTORY = history
120
  global PROMPT
121
- PROMPT = prompt
122
 
123
  if len(PROMPT)==0:
124
- PROMPT = random.choice(["ا","ب","پ","ت","ث","ج","چ","ح","خ","ل","م","ن","و",
125
  "د","ذ","ر","ز","ژ","س","ش","ص","ض","ط","ظ","ع","غ",
126
  "ف","ق","ه","ی",
127
  ])
 
 
128
 
129
  temperature = float(temperature)
130
  if temperature < 1e-2:
@@ -144,6 +145,8 @@ def generate(
144
  )
145
  #seed = seed + 1
146
  formatted_prompt = format_prompt(prompt, history, system_prompt)
 
 
147
 
148
  if len(ENDPOINT)>0:
149
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=False, details=True, return_full_text=False)
 
118
  global HISTORY
119
  HISTORY = history
120
  global PROMPT
 
121
 
122
  if len(PROMPT)==0:
123
+ prompt = random.choice(["ا","ب","پ","ت","ث","ج","چ","ح","خ","ل","م","ن","و",
124
  "د","ذ","ر","ز","ژ","س","ش","ص","ض","ط","ظ","ع","غ",
125
  "ف","ق","ه","ی",
126
  ])
127
+
128
+ PROMPT = prompt
129
 
130
  temperature = float(temperature)
131
  if temperature < 1e-2:
 
145
  )
146
  #seed = seed + 1
147
  formatted_prompt = format_prompt(prompt, history, system_prompt)
148
+
149
+ print(f"Formatted Prompt: {formatted_prompt}")
150
 
151
  if len(ENDPOINT)>0:
152
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=False, details=True, return_full_text=False)