alexkueck commited on
Commit
09c4aa0
·
verified ·
1 Parent(s): 91d278e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -208,7 +208,7 @@ def generate_text (prompt, chatbot, history, vektordatenbank, retriever, top_p=0
208
  endpoint_url=f"https://api-inference.huggingface.co/models/{MODEL_NAME_HF}",
209
  api_key=hf_token,
210
  temperature= 0.5,
211
- max_length = 2048,
212
  top_k=top_k,
213
  top_p=top_p,
214
  repetition_penalty=repetition_penalty
@@ -275,8 +275,8 @@ def generate_auswahl(prompt_in, file, file_history, chatbot, history, anzahl_doc
275
  #summary += " ".join(['Dokument: ' + str(doc['titel']) + ' Seite: ' + str(doc['seite']) + '\nAuschnitt: ' + str(doc["content"]) for doc in results['relevant_docs']])
276
  summary += " ".join([
277
  '<b>\nDokument: </b> <span style="color: #BB70FC;">' + str(doc['titel']) + '</span> '
278
- ' (<b>Seite:</b></span> <span style="color: red;">' + str(doc['seite']) + ')<br>'
279
- '<b>Auschnitt:</b> ' + str(doc["content"]) + '\n'
280
  for doc in results['relevant_docs']
281
  ])
282
  history = history + [[prompt_in, summary]]
 
208
  endpoint_url=f"https://api-inference.huggingface.co/models/{MODEL_NAME_HF}",
209
  api_key=hf_token,
210
  temperature= 0.5,
211
+ max_length = 1024,
212
  top_k=top_k,
213
  top_p=top_p,
214
  repetition_penalty=repetition_penalty
 
275
  #summary += " ".join(['Dokument: ' + str(doc['titel']) + ' Seite: ' + str(doc['seite']) + '\nAuschnitt: ' + str(doc["content"]) for doc in results['relevant_docs']])
276
  summary += " ".join([
277
  '<b>\nDokument: </b> <span style="color: #BB70FC;">' + str(doc['titel']) + '</span> '
278
+ ' (<b>Seite:</b></span> <span style="color: red;">' + str(doc['seite']) + '</span>)<br>'
279
+ '<span><b>Auschnitt:</b> ' + str(doc["content"]) + '</span>\n'
280
  for doc in results['relevant_docs']
281
  ])
282
  history = history + [[prompt_in, summary]]