Spaces:
Runtime error
Runtime error
# import gradio as gr | |
# pip install langchain[all] | |
import os | |
os.environ["HUGGINGFACEHUB_API_TOKEN"] = "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" | |
from langchain import PromptTemplate, HuggingFaceHub, LLMChain | |
template = """Question: {question} | |
Answer: Let's think step by step.""" | |
prompt = PromptTemplate(template=template, input_variables=["question"]) | |
llm=HuggingFaceHub(repo_id="google/flan-t5-xl", model_kwargs={"temperature":1e-10}) | |
question = "When was Google founded?" | |
print(llm_chain.run(question)) | |
# def greet(name): | |
# return "Hello " + name + "!!" | |
# iface = gr.Interface(fn=greet, inputs="text", outputs="text") | |
# iface.launch() |