Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,14 +8,14 @@ from langchain_text_splitters import RecursiveCharacterTextSplitter
|
|
| 8 |
import os
|
| 9 |
from dotenv import load_dotenv
|
| 10 |
|
| 11 |
-
hf_api_key = os.getenv("HF_TOKEN")
|
| 12 |
|
| 13 |
|
| 14 |
-
|
| 15 |
-
model_name = "google/gemma-2-9b"
|
| 16 |
|
| 17 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 18 |
-
model = AutoModelForCausalLM.from_pretrained(model_name,use_auth_token=hf_api_key)
|
| 19 |
|
| 20 |
def get_llm_response(input_prompt, content, prompt):
|
| 21 |
combined_input = f"{input_prompt}\nContent: {content}\nQuestion: {prompt}\nAnswer:"
|
|
|
|
| 8 |
import os
|
| 9 |
from dotenv import load_dotenv
|
| 10 |
|
| 11 |
+
#hf_api_key = os.getenv("HF_TOKEN")
|
| 12 |
|
| 13 |
|
| 14 |
+
model_name = "openai-community/gpt2"
|
| 15 |
+
#model_name = "google/gemma-2-9b"
|
| 16 |
|
| 17 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 18 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)#,use_auth_token=hf_api_key)
|
| 19 |
|
| 20 |
def get_llm_response(input_prompt, content, prompt):
|
| 21 |
combined_input = f"{input_prompt}\nContent: {content}\nQuestion: {prompt}\nAnswer:"
|