File size: 1,781 Bytes
5d3b777
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import os
from dataclasses import dataclass


@dataclass
class AppConfig:
    title = "Picture to Story Generator"
    theme = "freddyaboulton/dracula_revamped"
    css = "style.css"
    openai_max_access_count = 200
    openai_curr_access_count = None
    mongo_client = None
    db = "mydb"
    collection = "pic2story-openai-access-counter"
    key = "current_count"
    HF_TOKEN = os.getenv("HF_TOKEN")
    # OPENAI_KEY = os.getenv("OPENAI_KEY")
    # I2T_API_URL = os.getenv("I2T_API_URL")
    # MONGO_CONN_STR = os.getenv("MONGO_CONN_STR")
    genre_list = genre = [
        "Adventure",
        "Children Literature",
        "Comedy",
        "Drama",
        "Fantasy",
        "Fiction",
        "Horror",
        "Mystery",
        "Non-fiction",
        "Poetry",
        "Romance",
        "Satire",
        "Surrealism",
        "Urban Fantasy",
    ]
    writing_style_list = [
        "Cinematic",
        "Conversational",
        "Descriptive",
        "Experimental",
        "First-Person",
        "Formal",
        "Informal",
        "Metaphorical",
        "Minimalist",
        "Narrative",
        "Non-linear",
        "Objective",
        "Sensory",
        "Stream of Consciousness",
        "Symbolic",
        "Third-Person Limited",
        "Third-Person Omniscient",
    ]
    OPENAI_KEY = "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"
    # I2T_API_URL = (
    #     "https://api-inference.huggingface.co/models/Sof22/image-caption-large-copy"
    # )
    I2T_API_URL = ("https://api-inference.huggingface.co/models/Salesforce/blip2-opt-2.7b")
    MONGO_CONN_STR = "mongodb+srv://sssingh:Topsycret1@cluster0.fcwxggj.mongodb.net/"



app_config = AppConfig()