NVIDIA / NVIDIA/GenerativeAIExamples

RAG_PLAYGROUND - Error loading Knowledge Base Files

Offen
#311 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Jupyter Notebook
Sterne
4.2k
Forks
1.1k
Ø Merge
10 Std. 15 Min.
Gemergte PRs (30 T.)
1

Beschreibung

Hi,

Using Basic Examples, langchain or llamaindex, upload_button fail to upload .txt or .pdf files in "kb.py" file line 39
with gr.Row():
upload_button = gr.UploadButton("Add File", file_types=["pdf","txt"], file_count="multiple")

gradio.exceptions.Error: "Invalid file type. Please upload a file that is one of these formats: ['pdf', 'txt']"
Thanks for your help!

log below:


milvus-standalone | [2025/06/15 15:08:03.033 +00:00] [WARN] [dist/dist_handler.go:112] ["node last heart beat time lag too behind"] [now=2025/06/15 15:08:03.033 +00:00] [lastHeartBeatTime=2025/06/15 15:07:42.235 +00:00] [nodeID=14]
rag-playground | [1] Jun 15 15:07:46 [ INFO] - uvicorn.access - 172.20.0.1:45696 - "POST /content/kb/gradio_api/upload HTTP/1.1" 200
rag-playground | [1] Jun 15 15:07:46 [ INFO] - uvicorn.access - 172.20.0.1:45696 - "POST /content/kb/gradio_api/queue/join?__theme=light HTTP/1.1" 200
rag-playground | Traceback (most recent call last):
rag-playground | File "/usr/local/lib/python3.10/dist-packages/gradio/queueing.py", line 625, in process_events
rag-playground | response = await route_utils.call_process_api(
rag-playground | File "/usr/local/lib/python3.10/dist-packages/gradio/route_utils.py", line 322, in call_process_api
rag-playground | output = await app.get_blocks().process_api(
rag-playground | File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 2216, in process_api
rag-playground | inputs = await self.preprocess_data(
rag-playground | File "/usr/local/lib/python3.10/dist-packages/gradio/blocks.py", line 1882, in preprocess_data
rag-playground | processed_input.append(block.preprocess(inputs_cached))
rag-playground | File "/usr/local/lib/python3.10/dist-packages/gradio/components/upload_button.py", line 190, in preprocess
rag-playground | return [self._process_single_file(f) for f in payload] # type: ignore
rag-playground | File "/usr/local/lib/python3.10/dist-packages/gradio/components/upload_button.py", line 190, in
rag-playground | return [self._process_single_file(f) for f in payload] # type: ignore
rag-playground | File "/usr/local/lib/python3.10/dist-packages/gradio/components/upload_button.py", line 157, in _process_single_file
rag-playground | raise Error(
rag-playground | gradio.exceptions.Error: "Invalid file type. Please upload a file that is one of these formats: ['pdf', 'txt']"
rag-playground | [1] Jun 15 15:07:46 [ INFO] - uvicorn.access - 172.20.0.1:45696 - "GET /content/kb/gradio_api/queue/data?session_hash=6jcjgqfkk19 HTTP/1.1" 200

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne in kb.py ungefähr bei Zeile 39 und reproduziere den Upload anhand des Basic Examples-Ablaufs mit Dateien vom Typ .txt und .pdf. Überprüfe die in der traceback angezeigte Validierung von Gradio UploadButton; abgeschlossen ist die Aufgabe, wenn beide unterstützten Dateitypen erfolgreich hochgeladen werden, ohne den Fehler Invalid file type.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
ai
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.