File size: 835 Bytes
8cb5c12
717216b
8cb5c12
606cef9
8cb5c12
 
606cef9
8cb5c12
 
606cef9
8cb5c12
 
606cef9
8cb5c12
 
606cef9
8cb5c12
717216b
8cb5c12
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Import necessary libraries
import streamlit as st
from transformers import pipeline

# Load the text generation pipeline from Hugging Face
generator = pipeline('text-generation', model='EleutherAI/gpt-neo-2.7B')

# Title of the app
st.title('eyEar Assistant')

# Display introductory text
st.write("Welcome to eyEar, an AI assistant designed for the visually impaired. You can interact with the assistant by typing messages below.")

# Input box for user to type their message
user_input = st.text_input("Type a message to interact with eyEar:")

# If the user enters a message
if user_input:
    # Generate a response using the Hugging Face model
    response = generator(user_input, max_length=50, num_return_sequences=1)
    
    # Display the assistant's response
    st.write(f"eyEar Response: {response[0]['generated_text']}")