Spaces:
Paused

File size: 3,161 Bytes
a0d9624
51e964a
a0d9624
51e964a
 
 
ee34154
51e964a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ee34154
 
51e964a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ee34154
51e964a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a0d9624
51e964a
a0d9624
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
{% extends "base.html" %}
{% block title %}Inference · cuddly happy game platform{% endblock %}
{% block content %}

<section class="hero fade-up">
  <p class="eyebrow">kept for fun · original smoke test</p>
  <h1 class="display inference-title">Ping the models.<br><em>See what answers.</em></h1>
  <p class="lede">The original Hugging Face inference smoke test lives here. It asks a handful of trending conversational models a one-word prompt and records which ones reply.</p>
</section>

<div class="grid g-2 fade-up d1">
  <section class="panel">
    <div class="panel-head"><span class="panel-title">Token</span></div>
    <div class="panel-body stack">
      {% if status %}
      <div class="stat">
        <span class="k">state</span>
        <span class="v">{{ 'ok' if status.ok else 'not set' }}</span>
      </div>
      {% if status.name %}
      <div class="stat"><span class="k">account</span><span class="v">{{ status.name }}</span></div>
      {% endif %}
      {% if status.plan %}
      <div class="stat"><span class="k">plan</span><span class="v">{{ status.plan }}</span></div>
      {% endif %}
      {% if status.error %}
      <p class="faint" style="font-size:12.5px">{{ status.error }}</p>
      {% endif %}
      {% else %}
      <p class="faint" style="font-size:12.5px">{{ error or 'Inference module unavailable.' }}</p>
      {% endif %}
      <form action="/inference/run" method="POST" class="row" style="margin-top:6px">
        <label class="visually-hidden" for="model-limit">Number of models to test</label>
        <input class="field model-limit" id="model-limit" type="number" name="limit" value="3" min="1" max="10">
        <button class="btn btn-primary" type="submit">Run smoke test</button>
      </form>
      <p class="faint" style="font-size:11.5px">Needs an <span class="mono">HF_TOKEN</span> secret. Results persist to the Space's data volume.</p>
    </div>
  </section>

  <section class="panel">
    <div class="panel-head"><span class="panel-title">Latest run</span></div>
    <div class="panel-body stack">
      {% set run = result or latest %}
      {% if run %}
      <div class="row" style="gap:22px">
        <div class="stat"><span class="k">passed</span><span class="v">{{ run.passed }}</span></div>
        <div class="stat"><span class="k">failed</span><span class="v">{{ run.failed }}</span></div>
        <div class="stat"><span class="k">duration</span><span class="v">{{ run.duration_seconds }}s</span></div>
      </div>
      <hr class="divider">
      <div class="stack-8" role="status" aria-live="polite">
        {% for r in run.results %}
        <div class="row-between" style="font-size:13px">
          <span class="mono">{{ r.model_id }}</span>
          <span class="{{ 'mono' }}" style="color: {{ '#6fcf97' if r.ok else '#e06c75' }}">{{ 'ok' if r.ok else 'fail' }}</span>
        </div>
        {% endfor %}
      </div>
      {% else %}
      <p class="faint" style="font-size:13px">No runs yet.</p>
      {% endif %}
      {% if error %}
      <p class="faint" style="font-size:12px; color:#e06c75">{{ error }}</p>
      {% endif %}
    </div>
  </section>
</div>

{% endblock %}