Hi, what is the path to the following directory:
I have the following code in an app.py file:
import os
import streamlit as st
from transformers import AutoTokenizer, LlamaForCausalLM
import torch
model_directory = '/main/model'
if not os.path.exists(model_directory):
#model = LlamaForCausalLM.from_pretrained('TheBloke/Wizard-Vicuna-13B-Uncensored-HF')
#tokenizer = AutoTokenizer.from_pretrained('TheBloke/Wizard-Vicuna-13B-Uncensored-HF')
model.save_pretrained(model_directory)
tokenizer.save_pretrained(model_directory)
else:
model = LlamaForCausalLM.from_pretrained(model_directory)
tokenizer = AutoTokenizer.from_pretrained(model_directory)
st.title('Chat with LlamaForCausalLM Model')
user_input = st.text_input('Type your message', '')
if st.button('Send'):
inputs = tokenizer(user_input, return_tensors='pt')
generate_ids = model.generate(inputs.input_ids, max_length=30)
response = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
st.write(response)
In the above code, I have the path set to /main/model. This path does not exist.