Spaces:
Sleeping
Sleeping
Update
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def load_encoders():
|
|
62 |
import numpy as np
|
63 |
def b64(txt,vec):
|
64 |
buffer = io.BytesIO()
|
65 |
-
|
66 |
buffer.seek(0)
|
67 |
encoded = base64.b64encode(buffer.getvalue()).decode('utf-8')
|
68 |
return encoded
|
@@ -74,7 +74,7 @@ def convert(prompt):
|
|
74 |
prompt = [prompt]
|
75 |
txt = t5(prompt)
|
76 |
vec = clip(prompt)
|
77 |
-
return b64(txt
|
78 |
|
79 |
with gr.Blocks() as demo:
|
80 |
gr.Markdown("""A workaround for flux-flax to fit into 40G VRAM""")
|
|
|
62 |
import numpy as np
|
63 |
def b64(txt,vec):
|
64 |
buffer = io.BytesIO()
|
65 |
+
torch.save((txt,vec), buffer)
|
66 |
buffer.seek(0)
|
67 |
encoded = base64.b64encode(buffer.getvalue()).decode('utf-8')
|
68 |
return encoded
|
|
|
74 |
prompt = [prompt]
|
75 |
txt = t5(prompt)
|
76 |
vec = clip(prompt)
|
77 |
+
return b64(txt,vec)
|
78 |
|
79 |
with gr.Blocks() as demo:
|
80 |
gr.Markdown("""A workaround for flux-flax to fit into 40G VRAM""")
|