|
import streamlit as st |
|
import os |
|
|
|
from langchain import PromptTemplate, HuggingFaceHub, LLMChain |
|
|
|
x = st.slider('Select a value') |
|
st.write(x, 'squared is', x * x) |
|
|
|
|
|
|
|
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},huggingfacehub_api_token=HUGGING_FACE_API_KEY) |
|
|
|
question = "When was Google founded?" |
|
|
|
|
|
|
|
st.write("out",LLMChain.run(question)) |