Namitg02 commited on
Commit
78eb20d
·
verified ·
1 Parent(s): 24f81df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -64,7 +64,11 @@ pipe = pipeline(model = llm_model, tokenizer = tokenizer,trust_remote_code=True,
64
 
65
  question = "How can I reverse diabetes?"
66
  #docs1 = retriever.invoke(question)
67
- docs1 = retriever.invoke(get_relevant_documents)
 
 
 
 
68
 
69
  print(docs1[0].page_content)
70
  #print(docs1)[0]['generated_text'][-1]
@@ -76,8 +80,8 @@ print("check2")
76
  print("result")
77
 
78
  print("check3")
79
- #chain = pipe(question = question,context = "Use the following information to answer the question. docs1[0].page_content.")
80
- chain = pipe(question = question,context = "Use the following information to answer the question. Diabetes can be cured by eating apples.")
81
 
82
 
83
  print("check3A")
 
64
 
65
  question = "How can I reverse diabetes?"
66
  #docs1 = retriever.invoke(question)
67
+ docs1 = retriever.invoke(question)
68
+
69
+ import pandas as pd
70
+ df = pd.DataFrame(docs1, columns=["text"])
71
+ context = df.to_string()
72
 
73
  print(docs1[0].page_content)
74
  #print(docs1)[0]['generated_text'][-1]
 
80
  print("result")
81
 
82
  print("check3")
83
+ chain = pipe(question = question,context = "Use the following information to answer the question. {context}.")
84
+ #chain = pipe(question = question,context = "Use the following information to answer the question. Diabetes can be cured by eating apples.")
85
 
86
 
87
  print("check3A")