Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import random
|
|
| 3 |
import spaces
|
| 4 |
import os
|
| 5 |
|
| 6 |
-
from transformers import BitsAndBytesConfig
|
| 7 |
|
| 8 |
os.environ["KERAS_BACKEND"] = "tensorflow" #"jax" "torch"
|
| 9 |
os.environ["XLA_PYTHON_CLIENT_MEM_FRACTION"]="1.00"
|
|
@@ -11,7 +11,7 @@ os.environ["XLA_PYTHON_CLIENT_MEM_FRACTION"]="1.00"
|
|
| 11 |
import keras_hub
|
| 12 |
import keras
|
| 13 |
|
| 14 |
-
quantization_config = BitsAndBytesConfig(load_in_8bit=True)
|
| 15 |
|
| 16 |
models = [
|
| 17 |
"hf://tatihden/gemma_mental_health_2b_it_en",
|
|
@@ -21,7 +21,7 @@ models = [
|
|
| 21 |
|
| 22 |
clients = []
|
| 23 |
for model in models:
|
| 24 |
-
clients.append(keras_hub.models.GemmaCausalLM.from_preset(model
|
| 25 |
|
| 26 |
@spaces.GPU
|
| 27 |
def format_prompt(message, history):
|
|
|
|
| 3 |
import spaces
|
| 4 |
import os
|
| 5 |
|
| 6 |
+
#from transformers import BitsAndBytesConfig
|
| 7 |
|
| 8 |
os.environ["KERAS_BACKEND"] = "tensorflow" #"jax" "torch"
|
| 9 |
os.environ["XLA_PYTHON_CLIENT_MEM_FRACTION"]="1.00"
|
|
|
|
| 11 |
import keras_hub
|
| 12 |
import keras
|
| 13 |
|
| 14 |
+
#quantization_config = BitsAndBytesConfig(load_in_8bit=True)
|
| 15 |
|
| 16 |
models = [
|
| 17 |
"hf://tatihden/gemma_mental_health_2b_it_en",
|
|
|
|
| 21 |
|
| 22 |
clients = []
|
| 23 |
for model in models:
|
| 24 |
+
clients.append(keras_hub.models.GemmaCausalLM.from_preset(model))
|
| 25 |
|
| 26 |
@spaces.GPU
|
| 27 |
def format_prompt(message, history):
|