jh-didero commited on
Commit
92e13b2
·
verified ·
1 Parent(s): 0883892

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import openai
2
+ import gradio as gr
3
+ from pinecone import Pinecone
4
+
5
+ pc = Pinecone(api_key=api_key)
6
+ pinecone_index = pc.Index("si")
7
+ query_engine = index.as_query_engine()
8
+
9
+ def predict(message, history):
10
+ query_engine = index.as_query_engine()
11
+ streaming_response = query_engine.query(message)
12
+ return str(streaming_response)
13
+
14
+ history = []
15
+ gr.ChatInterface(predict).launch()