This commit is contained in:
2024-01-19 16:04:05 -07:00
parent e283e65868
commit 4469788d91
3 changed files with 3 additions and 8 deletions

View File

@ -102,14 +102,7 @@ func ReplicateImageGeneration(prompt string, filename string) (*bytes.Buffer, er
}
// Save image to a temporary file
var tmpfile *os.File
var err error
if filename != "" {
tmpfile, err = os.CreateTemp("", filename)
} else {
tmpfile, err = os.CreateTemp("", "image.*.jpg")
}
tmpfile, err := os.Create(filename)
if err != nil {
log.Fatal(err)

View File

@ -12,6 +12,7 @@ import (
func UploadToS3(filePath string) (*s3manager.UploadOutput, error) {
bucket := os.Getenv("BUCKET_NAME")
fmt.Println("The filepath is: ", filePath)
if bucket == "" {
fmt.Println("No S3 bucket specified, skipping upload.")
return nil, nil