Skip to content

Commit

Permalink
Fix catimage import (#15712)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlizzo committed Nov 17, 2022
1 parent f57160b commit ee517f3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lightning_app/components/serve/python_server.py
@@ -1,6 +1,5 @@
import abc
import base64
import os
from pathlib import Path
from typing import Any, Dict, Optional

Expand Down Expand Up @@ -28,8 +27,7 @@ class Image(BaseModel):

@staticmethod
def _get_sample_data() -> Dict[Any, Any]:
name = "lightning" + "_" + "app"
imagepath = Path(__file__.replace(f"lightning{os.sep}app", name)).absolute().parent / "catimage.png"
imagepath = Path(__file__).parent / "catimage.png"
with open(imagepath, "rb") as image_file:
encoded_string = base64.b64encode(image_file.read())
return {"image": encoded_string.decode("UTF-8")}
Expand Down

0 comments on commit ee517f3

Please sign in to comment.