Spaces:
Sleeping
Sleeping
Download app.py from aparnavellala/trialApp: direct link, hf CLI and curl.
- Browser
- Download file 732 Bytes
-
https://huggingface.co/spaces/aparnavellala/trialApp/resolve/main/app.py
- Command line
-
hf download hf://spaces/aparnavellala/trialApp/app.py
-
curl -L -o app.py https://huggingface.co/spaces/aparnavellala/trialApp/resolve/main/app.py
732 Bytes
| from langchain_huggingface import HuggingFaceEndpoint | |
| import spaces | |
| import gradio as gr | |
| llm = HuggingFaceEndpoint(repo_id="mistralai/Mistral-7B-Instruct-v0.3") | |
| #our_query = "What is the currency of India?" | |
| #completion= llm.invoke(our_query) | |
| #print(completion) | |
| def process_input_with_llm(text_input): | |
| completion= llm.invoke(text_input) | |
| print(completion) | |
| return completion | |
| # Define the Gradio interface | |
| iface = gr.Interface( | |
| fn=process_input_with_llm, | |
| inputs=[ | |
| gr.Textbox(label="Input Query"), | |
| ], | |
| outputs=[ | |
| gr.Textbox(label="Model Output"), | |
| ], | |
| title="LLM Model ", | |
| description="LLM Model" | |
| ) | |
| # Launch the Gradio app with sharing enabled | |
| iface.launch(share=True) |