Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
-
# app.py
|
2 |
import gradio as gr
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
4 |
import torch
|
5 |
|
6 |
def load_model():
|
7 |
-
model_name = "
|
8 |
|
9 |
# Konfiguracja kwantyzacji 4-bitowej
|
10 |
quantization_config = BitsAndBytesConfig(
|
@@ -22,7 +21,6 @@ def load_model():
|
|
22 |
trust_remote_code=True
|
23 |
)
|
24 |
return model, tokenizer
|
25 |
-
|
26 |
def generate_response(prompt, max_length=100):
|
27 |
try:
|
28 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
|
3 |
import torch
|
4 |
|
5 |
def load_model():
|
6 |
+
model_name = "TheBloke/Llama-2-13B-chat-GGUF" # Zmiana na publicznie dostępny model
|
7 |
|
8 |
# Konfiguracja kwantyzacji 4-bitowej
|
9 |
quantization_config = BitsAndBytesConfig(
|
|
|
21 |
trust_remote_code=True
|
22 |
)
|
23 |
return model, tokenizer
|
|
|
24 |
def generate_response(prompt, max_length=100):
|
25 |
try:
|
26 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|