Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
import torch
|
| 3 |
import numpy as np
|
| 4 |
import gradio as gr
|
| 5 |
-
|
| 6 |
import torch.nn.functional as F
|
| 7 |
from transformers import AutoTokenizer, AutoModel, AutoConfig
|
| 8 |
import time
|
|
@@ -177,7 +177,7 @@ def apply_constraints_to_state(
|
|
| 177 |
|
| 178 |
# --- Core Generation Logic with Live Visualization ---
|
| 179 |
|
| 180 |
-
|
| 181 |
@torch.no_grad()
|
| 182 |
def generate_dream_response(
|
| 183 |
history_dict_list: List[Dict[str, str]], # Now expects list of dicts
|
|
|
|
| 2 |
import torch
|
| 3 |
import numpy as np
|
| 4 |
import gradio as gr
|
| 5 |
+
import spaces # Ensure spaces is installed if needed for GPU decorator
|
| 6 |
import torch.nn.functional as F
|
| 7 |
from transformers import AutoTokenizer, AutoModel, AutoConfig
|
| 8 |
import time
|
|
|
|
| 177 |
|
| 178 |
# --- Core Generation Logic with Live Visualization ---
|
| 179 |
|
| 180 |
+
@spaces.GPU
|
| 181 |
@torch.no_grad()
|
| 182 |
def generate_dream_response(
|
| 183 |
history_dict_list: List[Dict[str, str]], # Now expects list of dicts
|