Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from langchain.prompts import PromptTemplate
|
| 3 |
from langchain_community.llms import CTransformers
|
| 4 |
-
from ctransformers import AutoModelForCausalLM
|
| 5 |
|
| 6 |
-
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
| 7 |
-
llm1 = AutoModelForCausalLM.from_pretrained("TheBloke/Llama-2-7b-Chat-GGUF", model_file="llama-2-7b-chat.q4_K_M.gguf", model_type="llama", gpu_layers=0)
|
| 8 |
|
| 9 |
print(llm("AI is going to"))
|
| 10 |
|
| 11 |
def GetLLMResponse(input_text,no_words,blog_type):
|
| 12 |
-
llm=
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
template=" wtite a blog for {blog_type} on topic of {input_text} in {no_words} words."
|
| 15 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from langchain.prompts import PromptTemplate
|
| 3 |
from langchain_community.llms import CTransformers
|
|
|
|
| 4 |
|
|
|
|
|
|
|
| 5 |
|
| 6 |
print(llm("AI is going to"))
|
| 7 |
|
| 8 |
def GetLLMResponse(input_text,no_words,blog_type):
|
| 9 |
+
llm=CTransformers(model="models\llama-2-7b-chat.ggmlv3.q8_0.bin",
|
| 10 |
+
model_type='llama',
|
| 11 |
+
config={'max_new_tokens':200,
|
| 12 |
+
'temperature':0.01})
|
| 13 |
|
| 14 |
template=" wtite a blog for {blog_type} on topic of {input_text} in {no_words} words."
|
| 15 |
|