Banjo Obayomi commited on
Commit
c1ab190
ยท
1 Parent(s): da8514d

update Readme

Browse files
Files changed (2) hide show
  1. README.md +3 -3
  2. app.py +13 -36
README.md CHANGED
@@ -1,8 +1,8 @@
1
  ---
2
  title: VisualNovelLM
3
- emoji: โšก
4
- colorFrom: red
5
- colorTo: red
6
  sdk: gradio
7
  sdk_version: 4.27.0
8
  app_file: app.py
 
1
  ---
2
  title: VisualNovelLM
3
+ emoji: ๐ŸŽฎ๐Ÿ“–๐Ÿค–
4
+ colorFrom: pink
5
+ colorTo: indigo
6
  sdk: gradio
7
  sdk_version: 4.27.0
8
  app_file: app.py
app.py CHANGED
@@ -70,31 +70,6 @@ def invoke_lambda_function(story_prompt, lore_file_s3_path):
70
  return None
71
 
72
 
73
- # def invoke_lambda_function(story_prompt, lore_file_s3_path):
74
- # payload = {"story_prompt": story_prompt, "lore_file": lore_file_s3_path}
75
- # try:
76
- # print("Invoking Lambda function...")
77
- # response = lambda_client.invoke(
78
- # FunctionName="renpy_builder",
79
- # InvocationType="RequestResponse",
80
- # Payload=json.dumps(payload),
81
- # )
82
- # print("Finished")
83
-
84
- # # Parse the response
85
- # response_payload = json.loads(response["Payload"].read())
86
- # print("Lambda response:", response_payload)
87
-
88
- # if response_payload.get("success", False):
89
- # return response_payload["download_url"]
90
- # else:
91
- # raise Exception(response_payload.get("message", "Unknown error"))
92
-
93
- # except Exception as e:
94
- # print(f"Error invoking Lambda: {str(e)}")
95
- # raise
96
-
97
-
98
  def load_existing_game(session_id):
99
  """Load an existing game by session ID"""
100
  if not session_id:
@@ -185,7 +160,9 @@ with gr.Blocks() as demo:
185
  placeholder="Describe the story you want to generate. Include details about the setting, main characters, and key plot points.",
186
  lines=5,
187
  )
188
- lore_file = gr.File(label="Upload lore document (optional)")
 
 
189
 
190
  # Add example prompts
191
  gr.Examples(
@@ -227,18 +204,18 @@ with gr.Blocks() as demo:
227
  fn=build_and_display_game, inputs=[story_prompt, lore_file], outputs=output
228
  )
229
 
230
- with gr.Tab("Load Existing Game"):
231
- gr.Markdown("Enter a session ID to load an existing game")
232
 
233
- session_id_input = gr.Textbox(
234
- label="Session ID", placeholder="Enter the session ID of an existing game"
235
- )
236
- load_button = gr.Button("Load Game")
237
- load_output = gr.HTML(label="Game Output")
238
 
239
- load_button.click(
240
- fn=load_existing_game, inputs=session_id_input, outputs=load_output
241
- )
242
 
243
  # Create FastAPI app
244
  app = FastAPI()
 
70
  return None
71
 
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  def load_existing_game(session_id):
74
  """Load an existing game by session ID"""
75
  if not session_id:
 
160
  placeholder="Describe the story you want to generate. Include details about the setting, main characters, and key plot points.",
161
  lines=5,
162
  )
163
+ lore_file = gr.File(
164
+ label="Upload lore document (optional)", file_types=["text"]
165
+ )
166
 
167
  # Add example prompts
168
  gr.Examples(
 
204
  fn=build_and_display_game, inputs=[story_prompt, lore_file], outputs=output
205
  )
206
 
207
+ # with gr.Tab("Load Existing Game"):
208
+ # gr.Markdown("Enter a session ID to load an existing game")
209
 
210
+ # session_id_input = gr.Textbox(
211
+ # label="Session ID", placeholder="Enter the session ID of an existing game"
212
+ # )
213
+ # load_button = gr.Button("Load Game")
214
+ # load_output = gr.HTML(label="Game Output")
215
 
216
+ # load_button.click(
217
+ # fn=load_existing_game, inputs=session_id_input, outputs=load_output
218
+ # )
219
 
220
  # Create FastAPI app
221
  app = FastAPI()