sudhir2016 commited on
Commit
00e0e0b
·
1 Parent(s): 4d0978d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -7,12 +7,13 @@ embeddings = HuggingFaceEmbeddings()
7
  #with open('Gita.txt') as f:
8
  #gita = f.read()
9
  gita="story of Arjun and Krishna refered to as song celestial"
10
- text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
11
- texts = text_splitter.split_text(gita)
12
- docsearch = Chroma.from_texts(texts, embeddings)
13
  def answer(query):
14
- docs = docsearch.similarity_search(query)
15
- out=docs[0].page_content
 
16
  return out
17
  demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples=[['song celestial']])
18
  demo.launch()
 
7
  #with open('Gita.txt') as f:
8
  #gita = f.read()
9
  gita="story of Arjun and Krishna refered to as song celestial"
10
+ #text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
11
+ #texts = text_splitter.split_text(gita)
12
+ #docsearch = Chroma.from_texts(texts, embeddings)
13
  def answer(query):
14
+ #docs = docsearch.similarity_search(query)
15
+ #out=docs[0].page_content
16
+ out=gita
17
  return out
18
  demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples=[['song celestial']])
19
  demo.launch()