TobyYang7 commited on
Commit
ca30e4f
1 Parent(s): f07fb5d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -7,6 +7,10 @@ import torch
7
  from PIL import Image
8
  import argparse
9
  import spaces
 
 
 
 
10
 
11
  parser = argparse.ArgumentParser()
12
  parser.add_argument("--model-path", type=str, default="TheFinAI/FinLLaVA")
@@ -58,6 +62,8 @@ def bot_streaming(message, history):
58
  # Use a streamer to generate the output in a streaming fashion
59
  streamer = []
60
 
 
 
61
  # Define a function to call chat_llava in a separate thread
62
  def generate_output():
63
  output = chat_llava(
 
7
  from PIL import Image
8
  import argparse
9
  import spaces
10
+ import os
11
+
12
+ root_path = os.path.dirname(os.path.abspath(__file__))
13
+ print(root_path)
14
 
15
  parser = argparse.ArgumentParser()
16
  parser.add_argument("--model-path", type=str, default="TheFinAI/FinLLaVA")
 
62
  # Use a streamer to generate the output in a streaming fashion
63
  streamer = []
64
 
65
+ image_file = image if isinstance(image, str) else image.filename
66
+
67
  # Define a function to call chat_llava in a separate thread
68
  def generate_output():
69
  output = chat_llava(