LangChain / app.py
sudhir2016's picture
Update app.py
4c1b6db verified
raw
history blame
409 Bytes
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()