Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from langchain_huggingface import HuggingFaceEndpoint | |
| llm = HuggingFaceEndpoint( | |
| repo_id="meta-llama/Meta-Llama-3-8B-Instruct", | |
| task="text-generation", | |
| max_new_tokens=100, | |
| do_sample=False, | |
| ) | |
| def answer(question): | |
| out=llm.invoke(question) | |
| return out | |
| demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples=[['What is the capital of India ?']]) | |
| demo.launch() |