Spaces:
Sleeping
Sleeping
Commit
·
167a25a
1
Parent(s):
021b704
adding you tube processing LLM
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
-
import
|
4 |
import logging
|
5 |
from langchain.document_loaders import PDFMinerLoader,CSVLoader ,UnstructuredWordDocumentLoader,TextLoader,OnlinePDFLoader
|
6 |
from langchain.text_splitter import CharacterTextSplitter
|
@@ -71,7 +71,6 @@ def youtube_chat(youtube_link,API_key,llm='HuggingFace',temperature=0.1,max_toke
|
|
71 |
)
|
72 |
return "Youtube link Processing completed ..."
|
73 |
|
74 |
-
|
75 |
css="""
|
76 |
#col-container {max-width: 700px; margin-left: auto; margin-right: auto;}
|
77 |
"""
|
@@ -86,16 +85,18 @@ title = """
|
|
86 |
</div>
|
87 |
"""
|
88 |
|
89 |
-
|
|
|
|
|
90 |
with gr.Column(elem_id="col-container"):
|
91 |
gr.HTML(title)
|
92 |
|
93 |
with gr.Group():
|
94 |
chatbot = gr.Chatbot(height=300)
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
|
100 |
with gr.Column():
|
101 |
with gr.Box():
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
+
from text_generation import Client
|
4 |
import logging
|
5 |
from langchain.document_loaders import PDFMinerLoader,CSVLoader ,UnstructuredWordDocumentLoader,TextLoader,OnlinePDFLoader
|
6 |
from langchain.text_splitter import CharacterTextSplitter
|
|
|
71 |
)
|
72 |
return "Youtube link Processing completed ..."
|
73 |
|
|
|
74 |
css="""
|
75 |
#col-container {max-width: 700px; margin-left: auto; margin-right: auto;}
|
76 |
"""
|
|
|
85 |
</div>
|
86 |
"""
|
87 |
|
88 |
+
|
89 |
+
with gr.Blocks(
|
90 |
+
css="""#chatbot {font-size: 14px;min-height: 300px;}""") as demo:
|
91 |
with gr.Column(elem_id="col-container"):
|
92 |
gr.HTML(title)
|
93 |
|
94 |
with gr.Group():
|
95 |
chatbot = gr.Chatbot(height=300)
|
96 |
+
with gr.Row():
|
97 |
+
question = gr.Textbox(label="Type your question !",lines=1).style(full_width=True)
|
98 |
+
submit_btn = gr.Button(value="Send message", variant="primary", scale = 1)
|
99 |
+
clean_chat_btn = gr.Button("Delete Chat")
|
100 |
|
101 |
with gr.Column():
|
102 |
with gr.Box():
|