DimaKoshman commited on
Commit
f94be16
1 Parent(s): 028951c
Files changed (2) hide show
  1. app.py +2 -6
  2. data.py +2 -2
app.py CHANGED
@@ -3,11 +3,7 @@ import pandas as pd
3
  from matplotlib import pyplot as plt
4
 
5
  from config import CONFIG
6
- from machine_learning.transformers.MakingGraphsAccessible.data import (
7
- get_extra_tokens,
8
- BenetechOutput,
9
- ChartType,
10
- )
11
  from model import predict_string, build_model
12
 
13
 
@@ -46,7 +42,7 @@ def main():
46
  interface = gradio.Interface(
47
  title="Making graphs accessible",
48
  description="Generate textual representation of a graph\n"
49
- "https://www.kaggle.com/competitions/benetech-making-graphs-accessible",
50
  fn=lambda image: predict_string(image, model),
51
  inputs="image",
52
  outputs="text",
 
3
  from matplotlib import pyplot as plt
4
 
5
  from config import CONFIG
6
+ from data import get_extra_tokens, BenetechOutput, ChartType
 
 
 
 
7
  from model import predict_string, build_model
8
 
9
 
 
42
  interface = gradio.Interface(
43
  title="Making graphs accessible",
44
  description="Generate textual representation of a graph\n"
45
+ "https://www.kaggle.com/competitions/benetech-making-graphs-accessible",
46
  fn=lambda image: predict_string(image, model),
47
  inputs="image",
48
  outputs="text",
data.py CHANGED
@@ -229,7 +229,7 @@ class AnnotatedImage:
229
 
230
  def generate_annotated_images():
231
  for image_id in tqdm.autonotebook.tqdm(
232
- load_train_image_ids(), "Iterating over annotated images"
233
  ):
234
  yield AnnotatedImage.from_image_id(image_id)
235
 
@@ -331,7 +331,7 @@ def convert_number_to_scientific_string(value: int or float) -> str:
331
 
332
 
333
  def convert_axis_data_to_string(
334
- axis_data: list[str or float], values_type: ValuesType
335
  ) -> str:
336
  formatted_axis_data = []
337
  for value in axis_data:
 
229
 
230
  def generate_annotated_images():
231
  for image_id in tqdm.autonotebook.tqdm(
232
+ load_train_image_ids(), "Iterating over annotated images"
233
  ):
234
  yield AnnotatedImage.from_image_id(image_id)
235
 
 
331
 
332
 
333
  def convert_axis_data_to_string(
334
+ axis_data: list[str or float], values_type: ValuesType
335
  ) -> str:
336
  formatted_axis_data = []
337
  for value in axis_data: