Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,8 +63,9 @@ def get_vram_info():
|
|
| 63 |
}
|
| 64 |
return {"vram": "CUDA not available"}
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
|
|
|
| 68 |
"""Encode text and return a downloadable pytorch file."""
|
| 69 |
global text_encoder, tokenizer
|
| 70 |
|
|
@@ -146,4 +147,4 @@ with gr.Blocks(title="Mistral Text Encoder") as demo:
|
|
| 146 |
|
| 147 |
|
| 148 |
if __name__ == "__main__":
|
| 149 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 63 |
}
|
| 64 |
return {"vram": "CUDA not available"}
|
| 65 |
|
| 66 |
+
|
| 67 |
+
@spaces.GPU(duration=20)
|
| 68 |
+
def encode_text(prompt: str):
|
| 69 |
"""Encode text and return a downloadable pytorch file."""
|
| 70 |
global text_encoder, tokenizer
|
| 71 |
|
|
|
|
| 147 |
|
| 148 |
|
| 149 |
if __name__ == "__main__":
|
| 150 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|