Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from transformers import pipeline | |
| # from langchain.llms import GooglePalm | |
| import os | |
| # #x = st.slider('Select a value') | |
| # #st.write(x, 'squared is', x * x) | |
| # #pipe = pipeline('sentiment-analysis') | |
| # api_key = os.environ["GOOGLE_PALM_API_KEY"] | |
| # llm = GooglePalm(google_api_key=api_key, temperature=0.1) | |
| import google.generativeai as palm | |
| google_api_key=os.getenv('GOOGLE_PALM_API_KEY') | |
| palm.configure(api_key=google_api_key) | |
| text = st.text_area('enter text to get assistance!') | |
| #prompt = 'Explain the difference between effective and affective with examples' | |
| prompt = text | |
| completion = palm.generate_text( | |
| model='models/text-bison-001', | |
| prompt=prompt, | |
| temperature=0.1 | |
| ) | |
| #print(completion.result) | |
| if text: | |
| #out = llm(text) | |
| out = completion.result; | |
| st.json(out) | |