File size: 2,530 Bytes
c8d5f7e
b34f0d5
b4cda3d
f9b088b
b4cda3d
 
 
b34f0d5
b4cda3d
 
c65ce97
b4cda3d
 
f1d1009
b4cda3d
 
b34f0d5
b4cda3d
 
f1d1009
b4cda3d
 
 
 
23fcae0
b4cda3d
 
 
 
 
 
23fcae0
c8d5f7e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b4cda3d
5c645bd
 
 
 
 
 
 
 
 
c8d5f7e
5c645bd
 
 
 
 
 
 
 
 
 
 
b4cda3d
c8d5f7e
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
66
67
68
69
70
71
from flask import Flask, request, render_template_string

app = Flask(__name__)

# 각 모델에 대한 처리 함수 (가상)
def 일반모델_처리(text):
    return f"일반모델 처리 결과: {text}"

def 코히어모델_처리(text):
    return f"코히어모델 처리 결과: {text}"

def 지피티모델_처리(text):
    return f"지피티모델 처리 결과: {text}"

def 클로드모델_처리(text):
    return f"클로드모델 처리 결과: {text}"

def 딥시크모델_처리(text):
    return f"딥시크모델 처리 결과: {text}"

@app.route('/', methods=['GET', 'POST'])
def index():
    if request.method == 'POST':
        input_text = request.form['reference_text']
        
        # 모든 모델에 대해 처리
        일반모델_결과 = 일반모델_처리(input_text)
        코히어모델_결과 = 코히어모델_처리(input_text)
        지피티모델_결과 = 지피티모델_처리(input_text)
        클로드모델_결과 = 클로드모델_처리(input_text)
        딥시크모델_결과 = 딥시크모델_처리(input_text)
        
        # 결과를 HTML로 반환
        return render_template_string('''
            <h1>모델 처리 결과</h1>
            <p><strong>일반모델:</strong> {{ 일반모델_결과 }}</p>
            <p><strong>코히어모델:</strong> {{ 코히어모델_결과 }}</p>
            <p><strong>지피티모델:</strong> {{ 지피티모델_결과 }}</p>
            <p><strong>클로드모델:</strong> {{ 클로드모델_결과 }}</p>
            <p><strong>딥시크모델:</strong> {{ 딥시크모델_결과 }}</p>
            <a href="/">다시 입력하기</a>
        ''', 
        일반모델_결과=일반모델_결과,
        코히어모델_결과=코히어모델_결과,
        지피티모델_결과=지피티모델_결과,
        클로드모델_결과=클로드모델_결과,
        딥시크모델_결과=딥시크모델_결과)
    
    return '''
    <!DOCTYPE html>
    <html lang="ko">
    <head>
        <meta charset="UTF-8">
        <title>블로그 생성기</title>
    </head>
    <body>
        <h1>참조글을 입력하세요</h1>
        <form method="post">
            <label>
                <strong>참조글:</strong><br>
                <textarea name="reference_text" rows="10" cols="50"></textarea>
            </label>
            <br>
            <input type="submit" value="블로그 생성">
        </form>
    </body>
    </html>
    '''

if __name__ == '__main__':
    app.run(debug=True)