tomas.helmfridsson commited on
Commit
0d62cf2
·
1 Parent(s): 6cf3540

update guis 8

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -46,8 +46,6 @@ with gr.Blocks() as demo:
46
  value=0.3,
47
  step=0.05,
48
  )
49
- # Laddningsindikator
50
- status_text = gr.Markdown("🔄 Laddar modellen, vänta...")
51
  # Chat-komponent (OpenAI-stil)
52
  chatbot = gr.Chatbot(type="messages")
53
  input_box = gr.Textbox(label="Din fråga")
@@ -57,18 +55,19 @@ with gr.Blocks() as demo:
57
  vectorstore, loaded_files = load_vectorstore()
58
  qa_chain = create_chain(vectorstore, temp_slider.value)
59
 
60
- # Dölj laddningsindikator och visa uppladdade filer
61
- status_text.visible = False
62
  gr.Markdown(
63
- f"✅ Klar! Du kan nu ställa frågor om dokumenten nedan:\n\n" +
64
- "\n".join([f"- {f}" for f in loaded_files])
 
 
 
65
  )
66
 
67
  # Chat-funktion
68
  def chat_fn(message, history, temp):
69
- # Uppdatera chain om temperaturen ändrats
70
  chain = create_chain(vectorstore, temp)
71
- # Lägg till användarens meddelande
72
  history = history + [{"role": "user", "content": message}]
73
  if len(message) > 1000:
74
  history = history + [{
@@ -94,4 +93,7 @@ with gr.Blocks() as demo:
94
  # Starta app vid körning
95
  if __name__ == "__main__":
96
  demo.launch()
 
 
 
97
 
 
46
  value=0.3,
47
  step=0.05,
48
  )
 
 
49
  # Chat-komponent (OpenAI-stil)
50
  chatbot = gr.Chatbot(type="messages")
51
  input_box = gr.Textbox(label="Din fråga")
 
55
  vectorstore, loaded_files = load_vectorstore()
56
  qa_chain = create_chain(vectorstore, temp_slider.value)
57
 
58
+ # Visa status och vilka PDF:er som laddats
59
+ gr.Markdown("🔄 Laddar modellen, vänta...")
60
  gr.Markdown(
61
+ f"✅ Klar! Du kan nu ställa frågor om dokumenten nedan:
62
+
63
+ " +
64
+ "
65
+ ".join([f"- {f}" for f in loaded_files])
66
  )
67
 
68
  # Chat-funktion
69
  def chat_fn(message, history, temp):
 
70
  chain = create_chain(vectorstore, temp)
 
71
  history = history + [{"role": "user", "content": message}]
72
  if len(message) > 1000:
73
  history = history + [{
 
93
  # Starta app vid körning
94
  if __name__ == "__main__":
95
  demo.launch()
96
+
97
+ if __name__ == "__main__":
98
+ demo.launch()
99