We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f57160b commit ee517f3Copy full SHA for ee517f3
src/lightning_app/components/serve/python_server.py
@@ -1,6 +1,5 @@
1
import abc
2
import base64
3
-import os
4
from pathlib import Path
5
from typing import Any, Dict, Optional
6
@@ -28,8 +27,7 @@ class Image(BaseModel):
28
27
29
@staticmethod
30
def _get_sample_data() -> Dict[Any, Any]:
31
- name = "lightning" + "_" + "app"
32
- imagepath = Path(__file__.replace(f"lightning{os.sep}app", name)).absolute().parent / "catimage.png"
+ imagepath = Path(__file__).parent / "catimage.png"
33
with open(imagepath, "rb") as image_file:
34
encoded_string = base64.b64encode(image_file.read())
35
return {"image": encoded_string.decode("UTF-8")}
0 commit comments