nick-leland commited on
Commit
d804135
·
1 Parent(s): 53715b3

Updated a lot of info here

Browse files
Files changed (7) hide show
  1. .gitignore +2 -0
  2. .gitmodules +3 -0
  3. app.py +48 -0
  4. money_generation.py +20 -0
  5. rd2l_pred +1 -0
  6. result_money.csv +10 -0
  7. todo.md +1 -0
.gitignore CHANGED
@@ -1 +1,3 @@
1
  venv/
 
 
 
1
  venv/
2
+ .venv/
3
+ __pycache__/
.gitmodules ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ [submodule "rd2l_pred"]
2
+ path = rd2l_pred
3
+ url = https://github.com/nick-leland/rd2l_pred
app.py CHANGED
@@ -1,11 +1,59 @@
1
  import gradio as gr
 
 
 
2
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
 
 
 
 
 
 
 
6
  # Needs a text input for dotabuff link
7
 
8
 
9
  demo = gr.Interface(fn=greet, inputs="textbox", outputs="text")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  demo.launch()
11
 
 
1
  import gradio as gr
2
+ import sys
3
+ sys.path.append("rd2l_pred")
4
+ from training_data_prep import list_format, modification, league_money, df_gen
5
 
6
  def greet(name):
7
  return "Hello " + name + "!!"
8
 
9
+
10
+ def fetch_data(user_input):
11
+ # We need to generate the inputs for the sheet using hugging face
12
+ # We also need to load the money values from the generated csv file
13
+ df_gen(draft, league_money(captains, data_type), data_type)
14
+ return
15
+
16
  # Needs a text input for dotabuff link
17
 
18
 
19
  demo = gr.Interface(fn=greet, inputs="textbox", outputs="text")
20
+ demo = gr.Interface(
21
+ fn=greet,
22
+ inputs=[
23
+ "textbox"
24
+ # gr.Image(type="filepath"),
25
+ # gr.Dropdown(["Pinch", "Spiral", "Shift Up", "Bulge", "Volcano"], value="Bulge", label="Function"),
26
+ # gr.Checkbox(label="Randomize inputs?"),
27
+ # gr.Slider(0, 0.5, value=0.25, label="Radius (as fraction of image size)"),
28
+ # gr.Slider(0, 1, value=0.5, label="Center X"),
29
+ # gr.Slider(0, 1, value=0.5, label="Center Y"),
30
+ # gr.Slider(0, 1, value=0.5, label="Strength"),
31
+ # gr.Slider(0, 1, value=0.5, label="Edge Smoothness"),
32
+ # gr.Slider(0, 0.5, value=0.1, label="Center Smoothness")
33
+ # gr.Checkbox(label="Reverse Gradient Direction"),
34
+ ],
35
+ # examples=[
36
+ # [np.asarray(Image.open("examples/1500_maze.jpg")), "Bulge", True, 0.25, 0.5, 0.5, 0.5],
37
+ # [np.asarray(Image.open("examples/2048_maze.jpg")), "Bulge", True, 0.25, 0.5, 0.5, 0.5],
38
+ # [np.asarray(Image.open("examples/2300_fresh.jpg")), "Bulge", True, 0.25, 0.5, 0.5, 0.5],
39
+ # [np.asarray(Image.open("examples/50_fresh.jpg")), "Bulge", True, 0.25, 0.5, 0.5, 0.5]
40
+ # ],
41
+ outputs=[
42
+ "text"
43
+ # gr.Image(label="Transformed Image"),
44
+ # gr.Image(label="bulge_model Model Classification"),
45
+ # gr.Image(label="yolov8n Model Classification"),
46
+ # gr.Image(label="yolov8x Model Classification"),
47
+ # gr.Label(),
48
+ # gr.Label(),
49
+ # gr.Image(label="Gradient Vector Field"),
50
+ # gr.Image(label="Inverse Gradient"),
51
+ # gr.Image(label="Inverted Vector Field"),
52
+ # gr.Image(label="Fixed Image")
53
+ ],
54
+ title="RD2L Pricing Prediction",
55
+ article="Uhhhhh this is the article",
56
+ description="Uhhhhh this is the description"
57
+ )
58
  demo.launch()
59
 
money_generation.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import os
3
+ from os import path
4
+
5
+ from rd2l_pred.training_data_prep import list_format, modification, league_money, df_gen
6
+
7
+ if __name__ == "__main__":
8
+ os.chdir("rd2l_pred/")
9
+ data_type = "prediction"
10
+
11
+ draft, captains = list_format("input")
12
+ money = league_money(captains, data_type)
13
+ result_money = money[list(money.keys())[0]]
14
+ season = list(money.keys())[0]
15
+
16
+ result_money.index.name = season
17
+
18
+ os.chdir("../")
19
+ result_money.to_csv("result_money.csv")
20
+ print("Saved?")
rd2l_pred ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 6e1cdcc6353edf1f4a17184ac3d0b9c836efa2a3
result_money.csv ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ S33,0
2
+ count,9.0
3
+ mean,499.1111111111111
4
+ std,82.31713740838606
5
+ min,362.0
6
+ 25%,464.0
7
+ 50%,525.0
8
+ 75%,559.0
9
+ max,597.0
10
+ sum,4492.0
todo.md ADDED
@@ -0,0 +1 @@
 
 
1
+ There should be a general install app here where it will install the submodule and then pip install -r requirements with gradio as well