naveensharma16 commited on
Commit
38fbfb5
·
verified ·
1 Parent(s): 2cd2ddc

Update document-based-assistant/app.py

Browse files
Files changed (1) hide show
  1. document-based-assistant/app.py +4 -3
document-based-assistant/app.py CHANGED
@@ -4,6 +4,7 @@ from retriever import load_document, chunk_text, embed_text, vector_store
4
  import torch
5
  from transformers import pipeline
6
  import gradio as gr
 
7
 
8
  docs = load_document("docs")
9
  chunks = []
@@ -37,7 +38,7 @@ summarize_tool = DocumentSummarizationTool(
37
  summarization_pipeline=summarization_pipeline
38
  )
39
 
40
- model = InferenceClientModel("naveensharma16/document-based-assistant")
41
  print("Loaded model:", model)
42
 
43
  agent = CodeAgent(
@@ -56,6 +57,6 @@ iface = gr.Interface(
56
  title="Document QA Agent"
57
  )
58
 
59
- if __name__ == "__main__":
60
- iface.launch(server_name="0.0.0.0", server_port=7860)
61
 
 
4
  import torch
5
  from transformers import pipeline
6
  import gradio as gr
7
+ from huggingface_hub import InferenceClient
8
 
9
  docs = load_document("docs")
10
  chunks = []
 
38
  summarization_pipeline=summarization_pipeline
39
  )
40
 
41
+ model = InferenceClientModel(client=InferenceClient(model="naveensharma16/document-based-assistant"))
42
  print("Loaded model:", model)
43
 
44
  agent = CodeAgent(
 
57
  title="Document QA Agent"
58
  )
59
 
60
+ # if __name__ == "__main__":
61
+ # iface.launch(server_name="0.0.0.0", server_port=7860)
62