Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,7 @@
|
|
|
|
1 |
import anthropic
|
2 |
|
3 |
-
client = anthropic.Anthropic(
|
4 |
-
# defaults to os.environ.get("ANTHROPIC_API_KEY")
|
5 |
-
api_key="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",
|
6 |
-
)
|
7 |
message = client.messages.create(
|
8 |
model="claude-3-opus-20240229",
|
9 |
max_tokens=1000,
|
@@ -13,4 +11,6 @@ message = client.messages.create(
|
|
13 |
{"role": "user", "content": "I had a dream last night that I was walking through a dense forest. The trees were tall and dark, and I could hear strange whispers coming from the shadows. Suddenly, I stumbled upon a clearing where I found a majestic white stag standing in the center. As I approached the stag, it transformed into a wise old man who handed me a golden key. Then I woke up. What could this dream mean?"}
|
14 |
]
|
15 |
)
|
16 |
-
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
import anthropic
|
3 |
|
4 |
+
client = anthropic.Anthropic(api_key="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")
|
|
|
|
|
|
|
5 |
message = client.messages.create(
|
6 |
model="claude-3-opus-20240229",
|
7 |
max_tokens=1000,
|
|
|
11 |
{"role": "user", "content": "I had a dream last night that I was walking through a dense forest. The trees were tall and dark, and I could hear strange whispers coming from the shadows. Suddenly, I stumbled upon a clearing where I found a majestic white stag standing in the center. As I approached the stag, it transformed into a wise old man who handed me a golden key. Then I woke up. What could this dream mean?"}
|
12 |
]
|
13 |
)
|
14 |
+
|
15 |
+
demo = gr.Interface(fn=lambda: message.content, inputs=["text"], outputs=["text"])
|
16 |
+
demo.launch()
|