Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,37 @@
|
|
1 |
-
import
|
|
|
2 |
import gradio as gr
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
import
|
7 |
-
import
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
|
11 |
#Konstanten
|
|
|
1 |
+
import requests
|
2 |
+
import os, sys, json
|
3 |
import gradio as gr
|
4 |
+
import time
|
5 |
+
import re
|
6 |
+
import io
|
7 |
+
from PIL import Image, ImageDraw, ImageOps, ImageFont
|
8 |
+
import base64
|
9 |
+
import tempfile
|
10 |
+
|
11 |
+
from PyPDF2 import PdfReader, PdfWriter
|
12 |
+
|
13 |
+
from hugchat import hugchat
|
14 |
+
from hugchat.login import Login
|
15 |
+
|
16 |
+
from langchain.chains import LLMChain, RetrievalQA
|
17 |
+
from langchain_openai import ChatOpenAI
|
18 |
+
from langchain.document_loaders import PyPDFLoader, WebBaseLoader, UnstructuredWordDocumentLoader, DirectoryLoader
|
19 |
+
from langchain.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoader
|
20 |
+
from langchain.document_loaders.generic import GenericLoader
|
21 |
+
from langchain.document_loaders.parsers import OpenAIWhisperParser
|
22 |
+
from langchain.schema import AIMessage, HumanMessage
|
23 |
+
from langchain.llms import HuggingFaceHub
|
24 |
+
from langchain.llms import HuggingFaceTextGenInference
|
25 |
+
from langchain_community.embeddings import HuggingFaceInstructEmbeddings, HuggingFaceEmbeddings, HuggingFaceBgeEmbeddings, HuggingFaceInferenceAPIEmbeddings
|
26 |
+
from langchain.retrievers.tavily_search_api import TavilySearchAPIRetriever
|
27 |
+
|
28 |
+
from langchain.embeddings.openai import OpenAIEmbeddings
|
29 |
+
from langchain.prompts import PromptTemplate
|
30 |
+
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
31 |
+
from langchain_community.vectorstores import Chroma
|
32 |
+
from chromadb.errors import InvalidDimensionException
|
33 |
+
from utils import *
|
34 |
+
from beschreibungen import *
|
35 |
|
36 |
|
37 |
#Konstanten
|