Spaces:
Runtime error
Runtime error
storresbusquets
commited on
Commit
·
5ed2636
1
Parent(s):
85574d1
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,23 @@
|
|
1 |
import gradio as gr
|
2 |
-
import torch
|
3 |
import transformers
|
4 |
-
from transformers import AutoTokenizer
|
5 |
from langchain import LLMChain, HuggingFacePipeline, PromptTemplate
|
6 |
import os
|
|
|
|
|
|
|
|
|
7 |
|
8 |
access_token = os.getenv("Llama2")
|
9 |
|
10 |
def greet(text):
|
11 |
|
12 |
-
model = "
|
13 |
-
tokenizer = AutoTokenizer.from_pretrained(model
|
|
|
|
|
|
|
14 |
|
15 |
pipeline = transformers.pipeline(
|
16 |
"text-generation",
|
|
|
1 |
import gradio as gr
|
2 |
+
# import torch
|
3 |
import transformers
|
4 |
+
# from transformers import AutoTokenizer
|
5 |
from langchain import LLMChain, HuggingFacePipeline, PromptTemplate
|
6 |
import os
|
7 |
+
from ctransformers import AutoModelForCausalLM, AutoTokenizer
|
8 |
+
|
9 |
+
model = AutoModelForCausalLM.from_pretrained("marella/gpt-2-ggml", hf=True)
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
11 |
|
12 |
access_token = os.getenv("Llama2")
|
13 |
|
14 |
def greet(text):
|
15 |
|
16 |
+
model = AutoModelForCausalLM.from_pretrained("marella/gpt-2-ggml", hf=True)
|
17 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
18 |
+
|
19 |
+
# model = "meta-llama/Llama-2-7b-hf"
|
20 |
+
# tokenizer = AutoTokenizer.from_pretrained(model, token=access_token)
|
21 |
|
22 |
pipeline = transformers.pipeline(
|
23 |
"text-generation",
|