Download app.py from Devis2awe/WebGPT: direct link, hf CLI and curl.
- Browser
- Download file 872 Bytes
-
https://huggingface.co/spaces/Devis2awe/WebGPT/resolve/main/app.py
- Command line
-
hf download hf://spaces/Devis2awe/WebGPT/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Devis2awe/WebGPT/resolve/main/app.py
872 Bytes
| import os | |
| import gradio as gr | |
| import ollama | |
| import bs4 | |
| from langchain.text_splitter import RecursiveCharacterTextSplitter | |
| from langchain_community.document_loaders import WebBaseLoader | |
| from langchain_community.vectorstores import Chroma | |
| from langchain_community.embeddings import OllamaEmbeddings | |
| from langchain_core.output_parsers import StrOutputParser | |
| from langchain_core.runnables import RunnablePassthrough | |
| ollama_path="/usr/local/lib/python3.10/site-packages/ollama" | |
| os.system(f"{ollama_path} ollama pull llama3") | |
| # os.system("ollama pull llama3") | |
| # os.system("ollama pull nomic-embed-text") | |
| def main( query , link ): | |
| return "Hello World" | |
| iface = gr.Interface( | |
| fn=main, | |
| inputs= | |
| [ | |
| gr.Textbox(label="Input Query"), | |
| gr.Textbox(label="Input Link"), | |
| ], | |
| outputs=["textbox"] | |
| ) | |
| if __name__ == "__main__": | |
| iface.launch() |