Update app.py
Browse files
app.py
CHANGED
@@ -60,10 +60,10 @@ model_name = "Daemontatox/CogitoZ14" # Replace with your desired model
|
|
60 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
61 |
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", trust_remote_code=True)
|
62 |
@spaces.GPU()
|
63 |
-
|
64 |
|
65 |
# LangChain LLM using Hugging Face Pipeline
|
66 |
-
llm = HuggingFacePipeline(pipeline=
|
67 |
|
68 |
# Create prompt template
|
69 |
template = """
|
|
|
60 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
61 |
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", trust_remote_code=True)
|
62 |
@spaces.GPU()
|
63 |
+
hf_pipeline = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
64 |
|
65 |
# LangChain LLM using Hugging Face Pipeline
|
66 |
+
llm = HuggingFacePipeline(pipeline=hf_pipeline)
|
67 |
|
68 |
# Create prompt template
|
69 |
template = """
|