kryox64 commited on
Commit
75eb0c5
1 Parent(s): 763d783

Remove progress bar due to issue in HF

Browse files

Signed-off-by: Aadhitya A <[email protected]>

Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -900,13 +900,12 @@ def guess_date(string):
900
 
901
  # %%
902
  # Main function
903
- def main(files, progress=gr.Progress()):
904
  # Get a list of all the CSV files uploaded
905
  prax = [0,0,0,0,0,0,0]
906
  for idx, file in enumerate(files):
907
  print(f"File #{idx+1}: {file}")
908
  print(file.name)
909
- progress(0,desc="Commencing App...")
910
  df = pd.read_csv(file.name)
911
  print(df['Ticker'][0])
912
  prax[0] = df['Ticker'][0]
@@ -919,33 +918,26 @@ def main(files, progress=gr.Progress()):
919
  df['Date/Time'][i] = x.strftime("%Y-%m-%d")
920
  df['Date/Time'] = pd.to_datetime(df['Date/Time'])
921
  df.fillna(0, inplace=True)
922
- progress(0.05,desc="Data Loaded...")
923
- progress(0.1,desc="Running TFT v1...")
924
  #df.to_csv('out.csv')
925
  modelTFT(df, prax)
926
  prax[2] = "TFT"
927
  generate_csv(prax)
928
- progress(0.3, desc="Running TFT v2...")
929
  modelTFT_OpenGap(df, prax)
930
  prax[2] = "TFT_OpenGap"
931
  generate_csv(prax)
932
  df.set_index('Date/Time', inplace=True)
933
- progress(0.5, desc="Running CNN-LSTM v1...")
934
  modelCNNLSTM(df, prax)
935
  prax[2] = "CNNLSTM"
936
  generate_csv(prax)
937
- progress(0.7, desc="Running CNN-LSTM v2...")
938
  modelCNNLSTM_OpenGap(df, prax)
939
  prax[2] = "CNNLSTM_OpenGap"
940
  #print("Saving to CSV...Standby...")
941
  generate_csv(prax)
942
  # Generate blank line
943
  prax=["","","","","","",""]
944
- progress(0.9, desc="Saving file...")
945
  generate_csv(prax)
946
  # Reset prax
947
  prax = [0,0,0,0,0,0,0]
948
- progress(1, desc="Complete!")
949
 
950
  if os.path.exists("lightning_logs"):
951
  shutil.rmtree("lightning_logs")
@@ -960,4 +952,4 @@ gradioApp = gr.Interface(fn=main, inputs=gr.File(file_count="multiple", file_typ
960
 
961
  if __name__ == "__main__":
962
  # Calling main function
963
- gradioApp.queue().launch()
 
900
 
901
  # %%
902
  # Main function
903
+ def main(files):
904
  # Get a list of all the CSV files uploaded
905
  prax = [0,0,0,0,0,0,0]
906
  for idx, file in enumerate(files):
907
  print(f"File #{idx+1}: {file}")
908
  print(file.name)
 
909
  df = pd.read_csv(file.name)
910
  print(df['Ticker'][0])
911
  prax[0] = df['Ticker'][0]
 
918
  df['Date/Time'][i] = x.strftime("%Y-%m-%d")
919
  df['Date/Time'] = pd.to_datetime(df['Date/Time'])
920
  df.fillna(0, inplace=True)
 
 
921
  #df.to_csv('out.csv')
922
  modelTFT(df, prax)
923
  prax[2] = "TFT"
924
  generate_csv(prax)
 
925
  modelTFT_OpenGap(df, prax)
926
  prax[2] = "TFT_OpenGap"
927
  generate_csv(prax)
928
  df.set_index('Date/Time', inplace=True)
 
929
  modelCNNLSTM(df, prax)
930
  prax[2] = "CNNLSTM"
931
  generate_csv(prax)
 
932
  modelCNNLSTM_OpenGap(df, prax)
933
  prax[2] = "CNNLSTM_OpenGap"
934
  #print("Saving to CSV...Standby...")
935
  generate_csv(prax)
936
  # Generate blank line
937
  prax=["","","","","","",""]
 
938
  generate_csv(prax)
939
  # Reset prax
940
  prax = [0,0,0,0,0,0,0]
 
941
 
942
  if os.path.exists("lightning_logs"):
943
  shutil.rmtree("lightning_logs")
 
952
 
953
  if __name__ == "__main__":
954
  # Calling main function
955
+ gradioApp.launch()