hyzhang00 commited on
Commit
619b05e
·
1 Parent(s): 71c3325

update on code

Browse files
.gitignore CHANGED
@@ -2,13 +2,7 @@ result/
2
  model_cache/
3
  *.pth
4
  teng_grad_start.sh
5
- *.jpg
6
- *.jpeg
7
- *.png
8
- *.svg
9
- *.gif
10
- *.tiff
11
- *.webp
12
 
13
 
14
  # Byte-compiled / optimized / DLL files
 
2
  model_cache/
3
  *.pth
4
  teng_grad_start.sh
5
+
 
 
 
 
 
 
6
 
7
 
8
  # Byte-compiled / optimized / DLL files
app.py CHANGED
@@ -111,12 +111,19 @@ async def init_openai_api_key(api_key=""):
111
  if api_key and len(api_key) > 30:
112
  print(api_key)
113
  if validate_api_key(api_key):
114
- return [gr.update(visible=True)]*4 + [gr.update(visible=False)]*2 + [gr.update(visible=True)]*2
 
 
 
 
 
 
 
115
  else:
116
  print("Invalid API key.")
117
  else:
118
  print("API key is too short.")
119
- return [gr.update(visible=False)]*5 + [gr.update(visible=True)]*2 + ['Your OpenAI API Key is not available']+[gr.update(visible=False)]*7
120
 
121
 
122
  def get_click_prompt(chat_input, click_state, click_mode):
 
111
  if api_key and len(api_key) > 30:
112
  print(api_key)
113
  if validate_api_key(api_key):
114
+ try:
115
+ # text_refiner = build_text_refiner(args.text_refiner, args.device, args, api_key)
116
+ text_refiner = None
117
+ print("text refiner")
118
+ except Exception as e:
119
+ print(f"Error initializing TextRefiner or ConversationBot: {e}")
120
+ text_refiner = None
121
+ return [gr.update(visible=True)]+[gr.update(visible=False)]+[gr.update(visible=True)]* 3 + [gr.update(visible=False)]*3 + [text_refiner, None]+[gr.update(visible=True)]*4+[gr.update(visible=False)]+[gr.update(visible=True)]*2
122
  else:
123
  print("Invalid API key.")
124
  else:
125
  print("API key is too short.")
126
+ return [gr.update(visible=False)]*6 + [gr.update(visible=True)]*2 + [text_refiner, 'Your OpenAI API Key is not available']+[gr.update(visible=False)]*7
127
 
128
 
129
  def get_click_prompt(chat_input, click_state, click_mode):
assets/test_images/1.The Ambassadors.jpg ADDED
assets/test_images/2.Football Players.jpg ADDED
assets/test_images/3-square.jpg ADDED

Git LFS Details

  • SHA256: e2a8f2e93e275b853d47803136cf8a8dc10f62001779a8d903ceb9c3678cc481
  • Pointer size: 132 Bytes
  • Size of remote file: 1.06 MB
assets/test_images/3.Along the River during the Qingming Festival.jpeg ADDED

Git LFS Details

  • SHA256: 3fc255019acfe629f0838ec225028f32f38b71ebd01a2abcaa8e261eae48a521
  • Pointer size: 132 Bytes
  • Size of remote file: 1.17 MB
assets/test_images/MUS.png ADDED
assets/test_images/Picture0.png ADDED
assets/test_images/Picture1.png ADDED
assets/test_images/Picture10.png ADDED
assets/test_images/Picture2.png ADDED
assets/test_images/Picture3.png ADDED
assets/test_images/Picture4.png ADDED
assets/test_images/Picture5.png ADDED
assets/test_images/Picture6.png ADDED
assets/test_images/Picture7.png ADDED
assets/test_images/Picture8.png ADDED
assets/test_images/Picture9.png ADDED
assets/test_images/img36.webp ADDED
assets/test_images/pearl.jpg ADDED
assets/test_images/qingming3.jpeg ADDED

Git LFS Details

  • SHA256: 3fc255019acfe629f0838ec225028f32f38b71ebd01a2abcaa8e261eae48a521
  • Pointer size: 132 Bytes
  • Size of remote file: 1.17 MB
assets/test_images/task1.jpg ADDED
assets/test_images/task2.jpg ADDED
assets/test_images/task3.jpg ADDED
assets/test_images/task4.jpg ADDED
assets/test_images/task5.jpg ADDED
assets/test_images/test1.jpg ADDED

Git LFS Details

  • SHA256: 75b3da6c93861df6abb2f2a61739b5bf01e32194f7fe531fbaf9b53b51235e2d
  • Pointer size: 132 Bytes
  • Size of remote file: 2.11 MB
assets/test_images/test2.jpg ADDED
assets/test_images/test3.jpg ADDED

Git LFS Details

  • SHA256: ab1dc56d3015fe34faa414be93dc6458a7d36c174baf37f46a1888932a60f84b
  • Pointer size: 132 Bytes
  • Size of remote file: 6.36 MB
assets/test_images/test4.jpg ADDED
assets/test_images/test5.jpg ADDED