Spaces:
Sleeping
Sleeping
File size: 1,106 Bytes
ef7727f eb33e79 ef7727f 08ff18c bee1be5 eb33e79 ef7727f eb33e79 ef7727f bee1be5 ef7727f eb33e79 247f7a9 ef7727f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import streamlit as st
from transformers import AutoTokenizer, AutoModelForCausalLM, AutoConfig
# Load the model and tokenizer from your Hugging Face Hub repository
model_name = "abdulllah01/outputs" # Replace with your Hugging Face repo name
# Load the model configuration first and modify it if necessary
config = AutoConfig.from_pretrained(model_name)
if hasattr(config, 'quantization_config'):
config.quantization_config = None # Disable any quantization settings
# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, config=config)
# Streamlit interface
st.title("Tech Support Chatbot")
st.write("Ask your technical support questions below:")
# Text input for the question
user_input = st.text_input("Your question:", "")
if user_input:
# Generate a response using the model
inputs = tokenizer.encode(user_input, return_tensors="pt")
response = model.generate(inputs, max_length=100)
answer = tokenizer.decode(response[0], skip_special_tokens=True)
st.write("**Answer:**", answer)
|