kryox64 commited on
Commit
6201f7a
·
1 Parent(s): eb75667

Edit app.py

Browse files
Files changed (2) hide show
  1. app-plain.py +1 -1
  2. app.py +3 -13
app-plain.py CHANGED
@@ -890,7 +890,7 @@ def guess_date(string):
890
  # Main function
891
  def main():
892
  # Data loading
893
- path = "./demo"
894
  print("Searching CSV files in ", path, "...")
895
  # path = "/kaggle/input/artemis-test"
896
 
 
890
  # Main function
891
  def main():
892
  # Data loading
893
+ path = "./tmp"
894
  print("Searching CSV files in ", path, "...")
895
  # path = "/kaggle/input/artemis-test"
896
 
app.py CHANGED
@@ -424,8 +424,6 @@ def modelTFT(csv_file, prax):
424
 
425
  #display(train.sample(4))
426
 
427
- """<a id ="3"></a><h3 style="background:#0554f2; border:0; border-radius: 4px; color:#f5f6f7">Model Implementation in Pytorch-Forecasting </h3>"""
428
-
429
  # Add a time_idx (an sequence of consecutive integers that goes from min to max date)
430
 
431
  data = (data.merge((data[['Date/Time']].drop_duplicates(ignore_index=True)
@@ -656,8 +654,6 @@ def modelTFT_OpenGap(csv_file, prax):
656
 
657
  #display(train.sample(4))
658
 
659
- """<a id ="3"></a><h3 style="background:#0554f2; border:0; border-radius: 4px; color:#f5f6f7">Model Implementation in Pytorch-Forecasting </h3>"""
660
-
661
  # Add a time_idx (an sequence of consecutive integers that goes from min to max date)
662
 
663
  data = (data.merge((data[['Date/Time']].drop_duplicates(ignore_index=True)
@@ -878,12 +874,6 @@ def generate_csv(data_list):
878
  writer.writerow(data_list)
879
  csv_file.close()
880
 
881
- def fileOutput():
882
- today = date.today().strftime("%Y_%m_%d")
883
- filename = f"result.csv"
884
- shutil.copyfile(filename, f"result_{today}.csv")
885
- return f"result_{today}.csv"
886
-
887
  def guess_date(string):
888
  for fmt in ["%Y/%m/%d", "%d-%m-%Y", "%Y%m%d", "%m/%d/%Y", "%d/%m/%Y", "%Y-%m-%d", "%d/%m/%y", "%m/%d/%y"]:
889
  try:
@@ -905,7 +895,7 @@ def main(files):
905
  prax[0] = df['Ticker'][0]
906
  prax[1] = df['Close'][len(df)-1]
907
  print('------------------')
908
- df = df.drop(['EMARSI'], axis=1)
909
  #df['Date/Time'] = pd.to_datetime(df['Date/Time'])
910
  for i in range(len(df)):
911
  x = guess_date(df['Date/Time'][i])
@@ -932,8 +922,8 @@ def main(files):
932
  generate_csv(prax)
933
  # Reset prax
934
  prax = [0,0,0,0,0,0,0]
935
- f1 = fileOutput()
936
- return f1
937
 
938
  gradioApp = gr.Interface(fn=main, inputs=gr.File(file_count="multiple", file_type=".csv"), outputs="file")
939
 
 
424
 
425
  #display(train.sample(4))
426
 
 
 
427
  # Add a time_idx (an sequence of consecutive integers that goes from min to max date)
428
 
429
  data = (data.merge((data[['Date/Time']].drop_duplicates(ignore_index=True)
 
654
 
655
  #display(train.sample(4))
656
 
 
 
657
  # Add a time_idx (an sequence of consecutive integers that goes from min to max date)
658
 
659
  data = (data.merge((data[['Date/Time']].drop_duplicates(ignore_index=True)
 
874
  writer.writerow(data_list)
875
  csv_file.close()
876
 
 
 
 
 
 
 
877
  def guess_date(string):
878
  for fmt in ["%Y/%m/%d", "%d-%m-%Y", "%Y%m%d", "%m/%d/%Y", "%d/%m/%Y", "%Y-%m-%d", "%d/%m/%y", "%m/%d/%y"]:
879
  try:
 
895
  prax[0] = df['Ticker'][0]
896
  prax[1] = df['Close'][len(df)-1]
897
  print('------------------')
898
+ #df = df.drop(['EMARSI'], axis=1)
899
  #df['Date/Time'] = pd.to_datetime(df['Date/Time'])
900
  for i in range(len(df)):
901
  x = guess_date(df['Date/Time'][i])
 
922
  generate_csv(prax)
923
  # Reset prax
924
  prax = [0,0,0,0,0,0,0]
925
+ today = date.today().strftime("%Y_%m_%d")
926
+ return f"result_{today}.csv"
927
 
928
  gradioApp = gr.Interface(fn=main, inputs=gr.File(file_count="multiple", file_type=".csv"), outputs="file")
929