Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,19 +21,16 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
| 21 |
MAX_IMAGE_SIZE = 1024
|
| 22 |
|
| 23 |
def remote_text_encoder(prompts):
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
}
|
| 31 |
)
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
prompt_embeds = torch.load(io.BytesIO(response.content))
|
| 36 |
-
|
| 37 |
return prompt_embeds
|
| 38 |
|
| 39 |
# Load model
|
|
|
|
| 21 |
MAX_IMAGE_SIZE = 1024
|
| 22 |
|
| 23 |
def remote_text_encoder(prompts):
|
| 24 |
+
from gradio_client import Client
|
| 25 |
+
|
| 26 |
+
client = Client("multimodalart/mistral-text-encoder")
|
| 27 |
+
result = client.predict(
|
| 28 |
+
prompt=prompts,
|
| 29 |
+
api_name="/encode_text"
|
|
|
|
| 30 |
)
|
| 31 |
+
|
| 32 |
+
prompt_embeds = torch.load(result[0])
|
| 33 |
+
|
|
|
|
|
|
|
| 34 |
return prompt_embeds
|
| 35 |
|
| 36 |
# Load model
|