jbilcke-hf HF staff commited on
Commit
d30f5cb
·
1 Parent(s): f6f0c40
src/analysis/analyzeImageWithIDEFICSAndNastyHack.mts CHANGED
@@ -70,12 +70,13 @@ export async function analyzeImage(image: string, prompt: string) {
70
  console.log(`uploading file..`)
71
  await fileField.uploadFile(tmpImageFilePath)
72
  // console.log(`did it work? did it do something?`)
 
73
 
74
  // console.log('looking for the button to submit')
75
  const submitButton = await page.$('button.lg')
76
 
77
  // console.log('clicking on the submit')
78
- // await submitButton.click()
79
 
80
  console.log("waiting for bot response..")
81
  await page.$('.message.bot')
@@ -87,9 +88,9 @@ export async function analyzeImage(image: string, prompt: string) {
87
  await sleep(12000)
88
 
89
  const message = await page.$$eval(".message.bot p", el => el.map(x => x.innerText)[0])
90
- console.log("message:", message)
91
 
92
- return message
93
  } catch (err) {
94
  throw err
95
  } finally {
 
70
  console.log(`uploading file..`)
71
  await fileField.uploadFile(tmpImageFilePath)
72
  // console.log(`did it work? did it do something?`)
73
+ // await sleep(2000)
74
 
75
  // console.log('looking for the button to submit')
76
  const submitButton = await page.$('button.lg')
77
 
78
  // console.log('clicking on the submit')
79
+ await submitButton.click()
80
 
81
  console.log("waiting for bot response..")
82
  await page.$('.message.bot')
 
88
  await sleep(12000)
89
 
90
  const message = await page.$$eval(".message.bot p", el => el.map(x => x.innerText)[0])
91
+ console.log("response:", message)
92
 
93
+ return message || ""
94
  } catch (err) {
95
  throw err
96
  } finally {