Spaces:
Build error
Build error
Download request/request.go from Jensen-holm/Numpy-Neuron: direct link, hf CLI and curl.
- Browser
- Download file 570 Bytes
-
https://huggingface.co/spaces/Jensen-holm/Numpy-Neuron/resolve/a4aa49156563601ea2a4cc2c2532ecb58ab4e971/request/request.go
- Command line
-
hf download hf://spaces/Jensen-holm/Numpy-Neuron@a4aa49156563601ea2a4cc2c2532ecb58ab4e971/request/request.go
-
curl -L -o request.go https://huggingface.co/spaces/Jensen-holm/Numpy-Neuron/resolve/a4aa49156563601ea2a4cc2c2532ecb58ab4e971/request/request.go
570 Bytes
| package request | |
| import ( | |
| "fmt" | |
| "github.com/go-gota/gota/dataframe" | |
| "github.com/gofiber/fiber/v2" | |
| ) | |
| type Payload struct { | |
| CSVData string `json:"csv_data"` | |
| Features []string `json:"features"` | |
| Target string `json:"target"` | |
| Algorithm string `json:"algorithm"` | |
| Args map[string]interface{} `json:"args"` | |
| Df dataframe.DataFrame | |
| } | |
| func (p *Payload) SetDf(df dataframe.DataFrame) { | |
| p.Df = df | |
| } | |
| func NewPayload(dest *Payload, c *fiber.Ctx) error { | |
| if err := c.BodyParser(dest); err != nil { | |
| return fmt.Errorf("invalid JSON data") | |
| } | |
| return nil | |
| } | |