Update app.py
Browse files
app.py
CHANGED
@@ -137,7 +137,7 @@ def file_anzeigen(file):
|
|
137 |
ext = analyze_file(file)
|
138 |
print("ext...............................")
|
139 |
print(ext)
|
140 |
-
if (ext == "png" or ext == "PNG" or ext == "jpg" or ext == "
|
141 |
return gr.Image(width=47, visible=True, interactive = False, height=47, min_width=47, show_label=False, show_share_button=False, show_download_button=False, scale = 0.5), file, file
|
142 |
else:
|
143 |
return gr.Image(width=47, visible=True, interactive = False, height=47, min_width=47, show_label=False, show_share_button=False, show_download_button=False, scale = 0.5), "data/file.png", file
|
@@ -231,7 +231,7 @@ def generate_auswahl(prompt, file, chatbot, history, rag_option, model_option, o
|
|
231 |
#Es wurde ein Bild angehängt -> wenn prompt dazu, das Bild analysieren
|
232 |
#geht nur über spezielle OpenAI-Schnittstelle...
|
233 |
ext = analyze_file(file)
|
234 |
-
if (ext == "png" or ext == "PNG" or ext == "
|
235 |
result= generate_text_zu_bild(file, prompt, k, rag_option, chatbot)
|
236 |
else:
|
237 |
result = generate_text_zu_doc(file, prompt, k, rag_option, chatbot)
|
|
|
137 |
ext = analyze_file(file)
|
138 |
print("ext...............................")
|
139 |
print(ext)
|
140 |
+
if (ext == "png" or ext == "PNG" or ext == "jpg" or ext == "jpeg" or ext == "JPG" or ext == "JPEG"):
|
141 |
return gr.Image(width=47, visible=True, interactive = False, height=47, min_width=47, show_label=False, show_share_button=False, show_download_button=False, scale = 0.5), file, file
|
142 |
else:
|
143 |
return gr.Image(width=47, visible=True, interactive = False, height=47, min_width=47, show_label=False, show_share_button=False, show_download_button=False, scale = 0.5), "data/file.png", file
|
|
|
231 |
#Es wurde ein Bild angehängt -> wenn prompt dazu, das Bild analysieren
|
232 |
#geht nur über spezielle OpenAI-Schnittstelle...
|
233 |
ext = analyze_file(file)
|
234 |
+
if (ext == "png" or ext == "PNG" or ext == "jpg" or ext == "jpeg" or ext == "JPG" or ext == "JPEG"):
|
235 |
result= generate_text_zu_bild(file, prompt, k, rag_option, chatbot)
|
236 |
else:
|
237 |
result = generate_text_zu_doc(file, prompt, k, rag_option, chatbot)
|