Arthur2G commited on
Commit
8a71ff7
·
1 Parent(s): ecfca00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -19
app.py CHANGED
@@ -19,8 +19,6 @@ from llama_index.indices.vector_store.base import GPTVectorStoreIndex
19
  from adlfs import AzureBlobFileSystem
20
  import time
21
 
22
- def ask_ai(doc,message):
23
- return message
24
 
25
  header = """<center><b><p style=\"color: #E13C32; font-size: 36px;\">My Ardian Chatbot</p></b></center>
26
  <i><p style=\"font-size: 16px; color: grey;\">Please make sure to formulate clear and precise questions and to add contextual information when possible. This will help the tool produce the most relevant response. Adopt an iterative approach and ask for more details or explanations when necessary.</br><i/></p>"""
@@ -34,23 +32,10 @@ theme = gr.themes.Base(
34
  )
35
 
36
 
37
- with gr.Blocks(theme=theme) as demo:
38
- gr.Markdown(header)
39
 
40
- download_button = gr.inputs.File(label="Upload a PDF")
41
- chatbot = gr.Chatbot()
42
- question = gr.Textbox(label='Question', info="Please write your question here.")
43
- clear = gr.Button("Clear")
44
-
45
- def respond(message, chat_history, doc):
46
- bot_message = ask_ai(doc, message)
47
- chat_history.append((message, bot_message))
48
- time.sleep(2)
49
- return "", chat_history
50
 
51
- question.submit(respond, [question, chatbot, download_button], [question, chatbot])
52
-
53
- clear.click(lambda: None, None, chatbot, queue=False)
54
- gr.Markdown(footnote)
55
 
56
- demo.launch()
 
19
  from adlfs import AzureBlobFileSystem
20
  import time
21
 
 
 
22
 
23
  header = """<center><b><p style=\"color: #E13C32; font-size: 36px;\">My Ardian Chatbot</p></b></center>
24
  <i><p style=\"font-size: 16px; color: grey;\">Please make sure to formulate clear and precise questions and to add contextual information when possible. This will help the tool produce the most relevant response. Adopt an iterative approach and ask for more details or explanations when necessary.</br><i/></p>"""
 
32
  )
33
 
34
 
 
 
35
 
36
+ def to_uppercase(text):
37
+ return text.upper()
 
 
 
 
 
 
 
 
38
 
39
+ iface = gr.Interface(fn=uppercto_ase, inputs="text", outputs="text")
40
+ iface.launch()
 
 
41